Adding a __filename__ predefined attribute to 2.5?

Rune Strand rune.strand at gmail.com
Wed Oct 12 02:31:07 EDT 2005


Is it an idea to include a new __filename__ predefined attribute to
2.5, so that __file__ contains the entire path to the module, and
__filename__ only the name of the module?

For instance it's useful to include a not-static reference to the
filename in a scripts usage() section and it's cumbersome to extract
the filename or to do module imports just to parse it.




More information about the Python-list mailing list