23 Nov
2013
23 Nov
'13
6 p.m.
On Nov 22, 2013 8:06 PM, "Steven D'Aprano" <steve@pearwood.info> wrote:
def __main__(argv): ...
is a cleaner (but less flexible) idiom that the current if __name__ business, and simpler for people to learn.
If I had a time machine I would either do the __main__ function or alternatively: if __main__: .... but alas I can't time travel and changing it will *not* be simpler to learn because people will be seeing both the old idiom and the new idiom for a long time. While it's interesting to discuss from the standpoint of what's the best design, it's just not worth changing, IMHO. --- Bruce