
I did a quick scan of the source code I have checkout. I see "no" as a variable in Python, PyPy, GitPython and setuptools. Adding "no" as a keyword will break at least those projects. Barry Here are the details: Python3/Lib/distutils/tests/test_util.py 249 no = ('n', 'no', 'f', 'false', 'off', '0', 'Off', 'No', 'N') Python3/Lib/test/test_descr.py 1752 no = NoWeak() Python3/Lib/pydoc.py 160 no = [] Python3/Lib/tkinter/messagebox.py 51 NO = "no" setuptools/dist.py 586 no = self.negative_opt.copy() GitPython/git/test/performance/test_commit.py 38 no = 0 pypy/rpython/translator/goal/bpnn.py 53 self.no = no pypy/rpython/rtyper/lltypesystem/ll2ctypes.py 809 no = _opaque_objs_seen[container] 811 no = len(_opaque_objs) pypy/rpython/jit/metainterp/test/test_warmspot.py 591 self.no = no 593 no = self.no 595 if no == 0: 597 if no == 1: 600 if no == 3: pypy/rpython/jit/tl/tinyframe/tinyframe.py 102 no = int(arg[1:]) pypy/rpython/jit/backend/test/test_random.py 177 no = len(self.descr_counters) 201 no = len(TYPE_NAMES) pypy/rpython/jit/backend/zarch/conditions.py 31 NO = ConditionLocation(0xe) # NO overflow pypy/rpython/jit/backend/llsupport/jitframe.py 123 no = 0 pypy/rpython/jit/tool/traceviewer.py 77 self.no = self.counter 206 no = int(m.group(1)) pypy/rpython/tool/jitlogparser/storage.py 81 no = int(comment[len('# bridge out of Guard 0x'):].split(' ', 1)[0], 16) 86 loop.no = no pypy/pypy/module/pypyjit/interp_resop.py 21 no = 0
On 1 Aug 2019, at 21:06, Daniel Okey-Okoro <danielokeyokoro@gmail.com> wrote:
I think that adding a `no` keyword as an alias for `not` would make for more readable, simple, pythonic code.
Take the below:
``` if not val: do_thing_because_value_is_falsy() ```
could be (is actually understood as):
``` if no val: do_thing_because_value_is_falsy() ```
I think this PEP is a work-around for an underlying subtle issue with how the `not` operator is used.
It has two use-cases:
1. as a NOT gate for producing opposite boolean values
``` opposite = not regular ```
2. as a sort of ".is_falsy()" checker; when used with an if statement.
like the first example.
This PEP would make the difference between the two usecases explicit.
Thoughts?
Best Intentions, Daniel Okey-Okoro. _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@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/JC6WOB... Code of Conduct: http://python.org/psf/codeofconduct/