8000 Withdraw PEP 531 based on python-ideas discussion · python/peps@9a70e51 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a70e51

Browse files
committed
Withdraw PEP 531 based on python-ideas discussion
1 parent eaa238b commit 9a70e51

File tree

1 file changed

+56
-1
lines changed

1 file changed

+56
-1
lines changed

pep-0531.txt

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Title: Existence checking operators
33
Version: $Revision$
44
Last-Modified: $Date$
55
Author: Nick Coghlan <ncoghlan@gmail.com>
6-
Status: Draft
6+
Status: Withdrawn
77
Type: Standards Track
88
Content-Type: text/x-rst
99
Created: 25-Oct-2016
@@ -52,6 +52,53 @@ following characteristics:
5252
(zeroes, empty containers) will still evaluate to True in an existence
5353
checking context
5454

55+
PEP Withdrawal
56+
==============
57+
58+
When posting this PEP for discussion on python-ideas [4_], I asked reviewers to
59+
consider 3 high level design questions before moving on to considering the
60+
specifics of this particular syntactic proposal:
61+
62+
1. Do we collectively agree that "existence checking" is a useful
63+
general concept that exists in software development and is distinct
64+
from the concept of "truth checking"?
65+
2. Do we collectively agree that the Python ecosystem would benefit
66+
from an existence checking protocol that permits generalisation of
67+
algorithms (especially short circuiting ones) across different "data
68+
missing" indicators, including those defined in the language
69+
definition, the standard library, and custom user code?
70+
3. Do we collectively agree that it would be easier to use such a
71+
protocol effectively if existence-checking equivalents to the
72+
truth-checking "and" and "or" control flow operators were available?
73+
74+
While the answers to the first question were generally positive, it quickly
75+
became clear that the answer to the second question is "No".
76+
77+
Steven D'Aprano articulated the counter-argument well in [5_], but the general
78+
idea is that when checking for "missing data" sentinels, we're almost always
79+
looking for a *specific* sentinel value, rather than *any* sentinel value.
80+
81+
``NotImplemented`` exists, for example, due to ``None`` being a potentially
82+
legitimate result from overloaded arithmetic operators and exception
83+
handling imposing too much runtime overhead to be useful for operand coercion.
84+
85+
Similarly, ``Ellipsis`` exists for multi-dimensional slicing support due to
86+
``None`` already have another meaning in a slicing context (indicating the use
87+
of the default start or stop indices, or the default step size).
88+
89+
In mathematics, the value of ``NaN`` is that *programmatically* it behaves
90+
like a normal value of its type (e.g. exposing all the usual attributes and
91+
methods), while arithmetically it behaves according to the mathematical rules
92+
for handling ``NaN`` values.
93+
94+
With that core design concept invalidated, the proposal as a whole doesn't
95+
make sense, and it is accordingly withdrawn.
96+
97+
However, the discussion of the proposal did prompt consideration of a potential
98+
protocol based approach to make the existing ``and``, ``or`` and ``if-else``
99+
operators more flexible [6_] without introducing any new syntax, so I'll be
100+
writing that up as another possible alternative to PEP 505.
101+
55102

56103
Relationship with other PEPs
57104
============================
@@ -584,6 +631,14 @@ References
584631
.. [3] FileFormat.info: Unicode Character 'THERE EXISTS' (U+2203)
585632
(http://www.fileformat.info/info/unicode/char/2203/index.htm)
586633

634+
.. [4] python-ideas discussion thread
635+
(https://mail.python.org/pipermail/python-ideas/2016-October/043415.html)
636+
637+
.. [5] Steven D'Aprano's critique of the proposal
638+
(https://mail.python.org/pipermail/python-ideas/2016-October/043453.html)
639+
640+
.. [6] Considering a link to the idea of overloadable Boolean operators
641+
(https://mail.python.org/pipermail/python-ideas/2016-October/043447.html)
587642

588643
Copyright
589644
=========

0 commit comments

Comments
 (0)
0