[issue14657] Avoid two importlib copies

Antoine Pitrou report at bugs.python.org
Wed Apr 25 14:46:59 CEST 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

> Looking at Antoine's patch, I'd be happier with it if it *didn't*
> mutate the attributes of _frozen_importlib, but instead just added
> importlib._bootstrap as an alias for accessing it.

I thought it would be nicer for __file__, __name__ and __package__ to reflect the actual source code metadata (__file__ is always a py file while __cached__ may point to the compiled bytecode). But I don't have any strong feelings about that.

Yes, __file__ can end up misleading if you modify the Python source without recompiling, but I think most people would only read the code without modifying it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14657>
_______________________________________


More information about the Python-bugs-list mailing list