22 Apr
2007
22 Apr
'07
7 p.m.
On 22 Apr 2007, at 19.50, Ron Adam wrote:
I also like the idea of having a way to say this_module.
if __module__ is sys.__main__: ...
Agreed... I suggested something like that a couple of days ago (except assuming __main__ would be a builtin global instead of in sys). I proposed __this__ as the name for accessing the current module. Mainly because I like the Englishlike way it reads: "if __this__ is __main__". 'If this is main' -- couldn't be simpler. Though I'd also be fine with sys.__main__ or sys.main (I'd prefer the latter). I would support having sys be an automatic global.