[Python-Dev] what can we do to hide the 'file' type? (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Thu Jul 6 07:24:03 CEST 2006


Brett Cannon wrote:

Can anyone think of any other way to gain access to 'file' without importing a module?

In principle, it might be possible to find file in the func_defaults or func_globals of some function, which might be defined as

orig_file = file def file(...): ...

I couldn't find any such function in the standard library, though.

Regards, Martin



More information about the Python-Dev mailing list