[Python-ideas] start, test, init

Andrew Barnert abarnert at yahoo.com
Mon Dec 2 09:42:13 CET 2013


On Dec 1, 2013, at 17:19, Mark Janssen <dreamingforward at gmail.com> wrote:

> 1)  I'd make "main" a keyword, used to denote the program start point,
> and let the interpreter bail-out if it encounters more than one "main"
> section.  Yes that keyword would only be used for that one, simple
> purpose, but it *is* a special purpose.  This would also solve the
> circular import issues, because now you have a well-defined *root* in
> which to construct a graph and check for cycles.

How does that solve circular import issues? There's already a well-defined root, __main__, today. And if there's a cycle, it's a cycle whether it involves the root or not. And if you're talking about moving imports into a function instead of at the top level, people already do that today, and it wouldn't work any better.


More information about the Python-ideas mailing list