Jeffrey Kintscher writes:

 > If you use a problematic practice and a change to Python causes a
 > symbol conflict for you, that's on you, not Python.

You are welcome to think that way.  It's not representative of the
Python development community, though.  We[1] care about breaking
existing code, even if we don't think much of it.

Furthermore, "from module import *" is implicitly blessed, not only by
that idiom itself (which requires special treatment in the parser!),
but also by the existence of the __all__ dunder, which allows module
authors to control which identifiers can be imported that way.  Given
that, evidently not all instances of "from module import *" are
problematic, and which are problematic is a matter of taste.  The
principle of "consenting adults" means that unless we have a good
reason, we'd rather avoid breaking *future* code that uses valid syntax.

A fairly tight sufficient condition is "there's no sane way to do it".
For example, if Serhiy's "from ast import literal_eval; literal_eval('1e1000')"
was the only way to spell infinity, there'd be an overwhelming sense
that "we gotta do something."  But when we already have two ways
("float('inf')" and "from math import inf; inf") you're gonna get
float('inf') pushback instead.

Footnotes: 
[1]  Yeah, I think I can speak for the community on this one.


_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/GHRHZNNPHN6WUN7PHPUI4TPI4ENOP5VC/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to