On 29 Aug 2008 15:21:53 GMT, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
On the python-dev mailing list, a question has be raised about a change
to module.__file__ in Python 3.

http://www.gossamer-threads.com/lists/python/dev/674923#674923

In Python 2.x, m.__file__ is the name of the file that the module was
imported from. That file might end with .py, .pyc, .pyo, or even more
exotic extensions if Python's import mechanism has been customized.

For reasons explained here:
http://bugs.python.org/issue1762972

Python 3.0 will introduce a patch that makes m.__file__ always specify
the source file (.py) if it exists, and only if that file doesn't exist
will it specify the actual file used (.pyc or .pyo).

This seems particularly pointless.  If __file__ were changed to make it
easier to handle by making the value have a more consistent meaning, then
it might be useful.  It sounds like the change is just making the failure
case more obscure and less likely to be noticed during testing, though.

Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to