On 28/05/2020 21:05, tritium-l...@sdamon.com wrote:
People write main entry points that are not exactly this?

If __name__ == '__main__':
     sys.exit(main(sys.argv[1:]))

Mostly I don't write main entry points at all. If I do the dance, it's more likely to be:

if __name__ == '__main__':
    test_this_module_to_destruction()

...though personally I prefer separate scripts for testing. For the main program, I'm generally using argparse so there's no need to mess with sys.argv directly, and why on earth would I add complexity and indentation with an entirely unnecessary function wrapper?

--
Rhodri James *-* Kynesim Ltd
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/3ZY6X3GKGXGCQQMYMNOPRAMV5CWIBPMZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to