[Python-ideas] PEP for executing a module in a package containing relative imports (original) (raw)

Adam Atlas adam at atlas.st
Mon Apr 23 02:00:44 CEST 2007


On 22 Apr 2007, at 19.50, Ron Adam wrote:

I also like the idea of having a way to say thismodule.

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.



More information about the Python-ideas mailing list