|
|
|
|
|
|
| Author |
Message |
bearophileHUGS@lycos.com *nix forums Guru Wannabe
Joined: 19 Feb 2005
Posts: 198
|
Posted: Thu Jul 20, 2006 3:21 pm Post subject:
Note on PEP 299
|
|
|
I don't like much the syntax of:
if __name__ == '__main__':
Some time ago I have read this PEP:
http://www.python.org/dev/peps/pep-0299/
And why it was refused:
http://mail.python.org/pipermail/python-dev/2006-March/062955.html
I think the name of the standard main function may be just main(), so
there isn't the problem with the import (and *maybe* the problem with
multiple Python versions can be ignored with Python 3.0).
If a module contains the main(), the main() is executed when the module
is run alone. Otherwise you can import the module, with the main()
function managed as a normal function.
Bye,
bearophile |
|
| Back to top |
|
 |
Terry Reedy *nix forums Guru
Joined: 21 Feb 2005
Posts: 544
|
Posted: Fri Jul 21, 2006 4:48 am Post subject:
Re: Note on PEP 299
|
|
|
<bearophileHUGS@lycos.com> wrote in message
news:1153408904.879310.139640@m79g2000cwm.googlegroups.com...
This idea, and a couple of variations, have come up in the Py3 discussions,
so something might be tried.
tjr |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sun Nov 23, 2008 2:35 pm | All times are GMT
|
|
Mortgages | Debt Consolidation | Credit Cards UK | Personal Loans | Flights to Cairo
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|