[docs] [issue12842] Docs: first parameter of tp_richcompare() always has the correct type

Stefan Krah report at bugs.python.org
Thu Aug 25 22:31:25 CEST 2011


New submission from Stefan Krah <stefan-usenet at 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 at python
components: Documentation
files: tp_richcompare.diff
keywords: patch
messages: 142991
nosy: docs at 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 at bugs.python.org>
<http://bugs.python.org/issue12842>
_______________________________________


More information about the docs mailing list