Roundup Robot devnull@devnull added the comment:
New changeset d27f95e3b52f by Eli Bendersky in branch '2.7':
Issue #10912: add clarification for PyObject_RichCompareBool comparing
identical objects
http://hg.python.org/cpython/rev/d27f95e3b52f
--
nosy: +python-dev
Changes by Eli Bendersky eli...@gmail.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10912
___
___
Python-bugs-list
Nick Coghlan ncogh...@gmail.com added the comment:
Reopening, as a 2.7 backport of this would be a nice thing to have.
--
assignee: rhettinger -
status: closed - open
versions: +Python 2.7
___
Python tracker rep...@bugs.python.org
Eli Bendersky eli...@gmail.com added the comment:
I agree that the difference in behavior between the two functions is
unfortunate, but that's unlikely to change now.
The least we can do is make the documentation precise. I'm attaching a proposed
patch to Doc/c-api/object.rst
Georg Brandl ge...@python.org added the comment:
Sure.
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10912
___
___
Eli Bendersky eli...@gmail.com added the comment:
Committed the fix to py3k in r88009
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10912
___
Eli Bendersky eli...@gmail.com added the comment:
Backport to release31 branch in r88010
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10912
___
Nick Coghlan ncogh...@gmail.com added the comment:
For the record, the gory details as to *why* RichCompareBool makes more
assumptions as to the meaning of equality than the basic RichCompare function
can be found in issue 4296 (I just found that issue myself by looking at Mark's
response to
Eli Bendersky eli...@gmail.com added the comment:
Nick, I read the protocol of issue 4296 and I understand the reasoning behind
the code, but I still think the naming is mightily confusing. Two distinct
changes went into a single function (A) Return -1/0/+1 instead of PyObject and
(B) the
Nick Coghlan ncogh...@gmail.com added the comment:
Yeah, to prevent perfectly reasonable why questions, it is probably worth
providing a little extra justification as an addendum to your new note (which
is already an improvement on the complete silence on the topic that existed
before).
A
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +Devin Jeanpierre
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10912
___
___
Python-bugs-list
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10912
___
___
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
-1 on PyObject_RichCompareBoolEx() for 3.3 -- it is simply an invitation to
shoot yourself (or others) in the foot.
I've not seen real world code using bool(a==b) or its C equivalent, so it's
hard to believe that there is a
Nick Coghlan ncogh...@gmail.com added the comment:
Indeed. I was actually wondering if it would be worth trying to write up a
section for the language reference to describe the cases where a Python
implementation is *expected* to assume reflexive equality. We (IMO) have a
problem at the
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
If something needs to be written about NaNs or other invariant destroying
objects, perhaps a FAQ entry would suffice (perhaps referencing
http://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/
).
Eli Bendersky eli...@gmail.com added the comment:
Raymond,
I initially set easy on this issue because I considered it a documentation
issue, not the place to resolve the harder debate of the semantics of these
functions. Perhaps I was wrong?
Also, I agree with Nick that the difference must
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Yes, it is a doc issue but sometimes those aren't easy to get right (in terms
of being beneficial to the reader and in good alignment with the design
intentions). Please attach the doc patch you want to go in and I'll
New submission from Devin Jeanpierre jeanpierr...@gmail.com:
PyObject_RichCoareBool is, according to the documentation in trunk
(Doc\c-api\object.rst), exactly the same as PyObject_RichCompare, except it 1,
0, or -1 for error, false, and true respectively. However, it differs in
behavior by
18 matches
Mail list logo