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

Steven Bethard steven.bethard at gmail.com
Sun Apr 22 07:10:16 CEST 2007


On 4/21/07, Brett Cannon <brett at python.org> wrote:

On 4/21/07, Josiah Carlson <jcarlson at uci.edu> wrote: > > After reading other posts in the thread, I'm going to put my support > into the sys.main variant. It has all of the benefits of the builtin name > == main, with none of the drawbacks (no builtin!), and only a slight > annoyance of 'import sys', which is more or less free.

Yeah, I am starting to like it as well. Steven and Jim, what do you think?

Note that the one benefit the sys.main-only variant doesn't have is the lower cognitive load of just having to know about main, instead of having to know about name, import and sys.main.

That said, since the PEP as it stands introduces a sys.main anyway, we might as well start with that. People can then play around with it and see if we need to introduce a main module attribute or builtin as well.

Steve

I'm not in-sane. Indeed, I am so far out of sane that you appear a tiny blip on the distant coast of sanity. --- Bucky Katt, Get Fuzzy



More information about the Python-ideas mailing list