[Python-ideas] PEP for executing a module in a package containing relative imports (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Mon Apr 23 00🔞22 CEST 2007
- Previous message: [Python-ideas] PEP for executing a module in a package containing relative imports
- Next message: [Python-ideas] PEP for executing a module in a package containing relative imports
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Steven Bethard wrote:
if there's nothing to be passed to the function, why make it a function at all?
I don't usually like to put big lumps of init code at the module level, because it pollutes the module namespace with local variables. So I typically end up with
def main(): ... ... ...
if name == "main": main()
So I'd be quite happy if I could just define a function called main() and be done with. I don't understand why there's so much opposition to that idea.
-- Greg
- Previous message: [Python-ideas] PEP for executing a module in a package containing relative imports
- Next message: [Python-ideas] PEP for executing a module in a package containing relative imports
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]