[Python-Dev] User's complaints (original) (raw)
Aaron Bingham bingham at cenix-bioscience.com
Thu Jul 13 10:53:59 CEST 2006
- Previous message: [Python-Dev] User's complaints
- Next message: [Python-Dev] Handling of sys.args (Re: User's complaints)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] User's complaints
- Next message: [Python-Dev] Handling of sys.args (Re: User's complaints)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]