Elias Tarhini wrote:
The thought of writing "operator.not" is appealing, but
being forced to use *that* (with *from operator import not* being
non-allowable) may not be.
Under the proposal I made in my last post, "from operator import not"
would be fine -- you just wouldn't be able to use the "not" operator
anywhere in the module then. :-)
A more nuanced version would have the effect restricted to the
scope the import appears in, so that you could write
def f():
from operator import not
# 'not' is now an ordinary name inside this
# function, but it's business as usual elsewhere
Someone else can figure out how to make the parser handle
this, though. :-)
--
Greg
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/