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-July/067338.html below:

[Python-Dev] User's complaints

[Python-Dev] User's complaints [Python-Dev] User's complaintsAaron Bingham bingham at cenix-bioscience.com
Thu Jul 13 10:53:59 CEST 2006
Aaron Bingham wrote:

>Ka-Ping Yee wrote:
>
>  
>
>>Why not simply:
>>
>>   def __main__():
>>       ...
>>
>>or even pass in the command-line arguments:
>>
>>   def __main__(*args):
>>       ...
>>
>>Having to 'import sys' to get at the command-line arguments always
>>seemed awkward to me.  'import sys' feels like it should be a
>>privileged operation (access to interpreter internals), and getting
>>the command-line args isn't privileged.
>> 
>>
>>    
>>
>+1, seems a lot more elegant than "if __name__ == '__main__'"
>  
>
Just to clarify, I was writing in support of Ping's suggestion of def 
__main__() or def __main__(*args).  The decorator-based solution is ugly.

Regards,

-- 
--------------------------------------------------------------------
Aaron Bingham
Senior Software Engineer
Cenix BioScience GmbH
--------------------------------------------------------------------

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