[issue12842] Docs: first parameter of tp_richcompare() always has the correct type
New submission from Stefan Krah <stefan-usenet@bytereef.org>: 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: Objects/cellobject.c: if (!PyCell_Check(a) || !PyCell_Check(b)) { The attached patch makes it clear that the first parameter has the correct type. ---------- assignee: docs@python components: Documentation files: tp_richcompare.diff keywords: patch messages: 142991 nosy: docs@python, skrah priority: normal severity: normal status: open title: Docs: first parameter of tp_richcompare() always has the correct type type: feature request versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23047/tp_richcompare.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12842> _______________________________________
Changes by Éric Araujo <merwok@netwok.org>: ---------- keywords: +needs review stage: -> patch review versions: -Python 3.1 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12842> _______________________________________
Mark Lawrence added the comment: The patch has never been applied. I'm not qualified to state whether or not it is correct. ---------- nosy: +BreamoreBoy _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12842> _______________________________________
Andrew Svetlov added the comment: Fixed in 71a0743f36db and 06bdd7e8fffd ---------- nosy: +asvetlov resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.4, Python 3.5 -Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12842> _______________________________________
participants (4)
-
Andrew Svetlov
-
Mark Lawrence
-
Stefan Krah
-
Éric Araujo