Roundup Robot added the comment:
New changeset ebb8865dcf54 by Ethan Furman in branch '3.4':
(3.4) Issue22780: reword NotImplemented docs to emphasise should
https://hg.python.org/cpython/rev/ebb8865dcf54
New changeset b6ee02acaae9 by Ethan Furman in branch 'default':
Issue22780: reword
Ethan Furman added the comment:
Thank you, Berker.
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
___
Ethan Furman added the comment:
Here's the latest patch. Thoughts?
--
keywords: +patch
stage: resolved - patch review
Added file: http://bugs.python.org/file37254/issue22780.stoneleaf.01.patch
___
Python tracker rep...@bugs.python.org
R. David Murray added the comment:
try the reflected operation is not our standard terminology. There is a
reason I suggested *copying* the parenthetical statement. We essentially have
two places where NotImplemented is described (language reference and library
reference), and the
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
___
Ethan Furman added the comment:
R. David Murray said:
try the reflected operation is not our standard terminology.
Parenthetical under discussion:
---
(The interpreter will then try the reflected operation, or some other
fallback,
depending
R. David Murray added the comment:
OK, you got me there :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
___
___
Python-bugs-list mailing
Ethan Furman added the comment:
Whew!
If a different wording is better, I'm happy to change both places. :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
___
Ethan Furman added the comment:
+ Special value which should be returned by the special methods
+ (:meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, etc.) to indicate
+ that the operation is not implemented with respect to the other type.
After a discussion on python-dev, I think this
R. David Murray added the comment:
Sounds OK to me. There should already be a discussion of the consequences of
returning it (I don't remember where, though), and it would be nice to link to
that discussion.
Note that any doc change should be applied to 3.4 first, and then merged to 3.5.
Ethan Furman added the comment:
I found these items:
Doc/c-api/object.rst
.. c:var:: PyObject* Py_NotImplemented
The ``NotImplemented`` singleton, used to signal that an operation is
not implemented for the given type combination.
Doc/extending/newtypes.rst
R. David Murray added the comment:
I was actually thinking of the Implementing the arithmetic operations section.
Maybe we should copy the parenthetical from the datamodel description into the
text you are modifying, and then link to the implementing section.
--
Raymond Hettinger added the comment:
FWIW, I think doc changes like this need to be made by the people most familiar
with the implementation details and with the original design intent (i.e. the
authors of PEP 207).
The knowledge here is fragile and it would be easy to accidentally make-up
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
Removed message: http://bugs.python.org/msg230579
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
___
Ethan Furman added the comment:
Thank you, Raymond, both for your concern and your discretion.
My interest in changing the can or may to should is that, whatever the
original intent of the PEP, the way Python works /now/ is that any class that
doesn't return NotImplemented when it /should/ is
Ethan Furman added the comment:
How about:
Special value which should be returned by the binary special methods
(e.g. :meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, :meth:`__rsub__`,
etc.) to indicate that the operation is not implemented with respect to
the other type; may be
Georg Brandl added the comment:
You add a label before that section and then reference it with :ref:.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
___
Ethan Furman added the comment:
Here's the actual change:
+ Special value which should be returned by the special methods
+ (:meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, etc.) to indicate
+ that the operation is not implemented with respect to the other type.
I'll update the Enum
New submission from Ethan Furman:
https://docs.python.org/3/library/constants.html
current
---
Special value which can be returned by the “rich comparison” special
methods (__eq__(), __lt__(), and friends), to indicate that the comparison is
not implemented with respect to the other
Roundup Robot added the comment:
New changeset 26d0a17affb5 by Ethan Furman in branch 'default':
issue22780: update NotImplemented description
https://hg.python.org/cpython/rev/26d0a17affb5
--
nosy: +python-dev
___
Python tracker
Changes by Ethan Furman et...@stoneleaf.us:
--
stage: needs patch - resolved
status: open - closed
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22780
___
R. David Murray added the comment:
The replacement of the term 'special methods' and the examples with the jargon
(used nowhere else in the docs that I'm aware of) of '__dunder__' makes the
text very confusing. Please restore 'special methods' and the examples...you
could include
22 matches
Mail list logo