A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-February/098004.html below:

[Python-Dev] __file__

[Python-Dev] __file__ [Python-Dev] __file__Nick Coghlan ncoghlan at gmail.com
Sat Feb 27 16:27:42 CET 2010
Glenn Linderman wrote:
> But if the technique can work from the command line, it seems the
> same technique could be re-used in the importer.

Not really - we only get away with the fun and games at execution time
because __main__ is a bit special (and always has been). Those tricks
would be a lot harder to pull off for a normal module import (if they
were possible at all - I'm not sure they would be).

Cheers,
Nick.


-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4