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/2006-March/062955.html below:

[Python-Dev] What about PEP 299?

[Python-Dev] What about PEP 299? [Python-Dev] What about PEP 299?Phillip J. Eby pje at telecommunity.com
Tue Mar 28 21:47:07 CEST 2006
At 09:22 PM 3/28/2006 +0200, Georg Brandl wrote:
>Hi,
>
>since I found myself writing "if __name__ == '__main__'"
>often these days, I wondered whether PEP 299 could be pronounced
>upon. I'm not proposing putting it into 2.5, but it should be
>relatively small a change.

A couple of issues that the PEP doesn't address:

* How can you write code that runs in multiple Python versions with 
this?  If you use the current idiom to invoke __main__, it's going to get 
invoked twice.

* A module that imports __main__ (using "import __main__") is going to get 
a TypeError unless the implementation checks that __main__ is not in fact 
the __main__ module.

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