This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Docs: first parameter of tp_richcompare() always has the correct type
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.4, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: BreamoreBoy, asvetlov, docs@python, skrah
Priority: normal Keywords: needs review, patch

Created on 2011-08-25 20:31 by skrah, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
tp_richcompare.diff skrah, 2011-08-25 20:31 review
Messages (3)
msg142991 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2011-08-25 20:31
I've noticed that assumptions about the operand types in tp_richcompare()
are not always consistent. As far as I can see, the first parameter
in tp_richcompare() is guaranteed to be of the correct type.

But in some places the first parameter's type is still checked:


    if (!PyCell_Check(a) || !PyCell_Check(b)) {

The attached patch makes it clear that the first parameter has
the correct type.
msg221489 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-24 20:09
The patch has never been applied.  I'm not qualified to state whether or not it is correct.
msg222173 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2014-07-03 13:09
Fixed in 71a0743f36db and 06bdd7e8fffd
Date User Action Args
2022-04-11 14:57:21adminsetgithub: 57051
2014-07-03 13:09:29asvetlovsetstatus: open -> closed

versions: + Python 3.4, Python 3.5, - Python 2.7, Python 3.2, Python 3.3
nosy: + asvetlov

messages: + msg222173
resolution: fixed
stage: patch review -> resolved
2014-06-24 20:09:45BreamoreBoysetnosy: + BreamoreBoy
messages: + msg221489
2011-08-26 15:16:10eric.araujosetkeywords: + needs review
stage: patch review
versions: - Python 3.1
2011-08-25 20:31:24skrahcreate