
Paul Sokolovsky pmiscml@gmail.com writes:
I find it quite a sign of problem, because if one accepts that one can't just run a script right away, but needs to do extra steps, then well, that enterprisey niche is pretty crowded and there're more choices how to make it more complicated.
Python's BDFL has spoken of running modules with relative import as top-level scripts:
I'm -1 on this and on any other proposed twiddlings of the __main__ machinery. The only use case seems to be running scripts that happen to be living inside a module's directory, which I've always seen as an antipattern. To make me change my mind you'd have to convince me that it isn't.
URL:https://mail.python.org/pipermail/python-3000/2007-April/006793.html
He doesn't describe (that I can find) what makes him think it's an antipattern, so I'm not clear on how he expects to be convinced it's a valid pattern. Nonetheless, that appears to be the hurdle you'd need to confront.