Hello, On Fri, 29 May 2020 05:33:57 +1000 Chris Angelico <rosuav@gmail.com> wrote: []
People can already put all their main logic into a function. If you want to unit-test your main function, that's the best way to do it. The trouble is, how much goes into main() and how much into if __name__ == '__main__'? For example: Does your main function accept a list of arguments, or does it look in sys.argv? Neither answer is wrong. And that means the best way is to NOT force everyone across all of Python to choose the same way - let people write their code their way.
Yes. Besides, "principled" and "uncompromising" linters and code formatters are recently on a rise, so hopefully everyone/every team can choose a style per their likes, without putting burden on all the other users of the language.
ChrisA
-- Best regards, Paul mailto:pmiscml@gmail.com