[Python-checkins] python/nondist/peps pep-0207.txt,1.10,1.11

bwarsaw at users.sourceforge.net bwarsaw at users.sourceforge.net
Fri Aug 6 01:16:27 CEST 2004


Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11822

Modified Files:
	pep-0207.txt 
Log Message:
Repaired a few places where the PEP was incorrect or out of touch with
reality.  Specifically, the third argument to PyObject_RichCompare* is an int,
not an enum.  Also, when the tp_richcompare function cannot compare the
combination of objects, it needs to return Py_NotImplemented, not
PyExc_NotImplemented (and a new reference to that object at that).


Index: pep-0207.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0207.txt,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** pep-0207.txt	5 Feb 2001 15:56:04 -0000	1.10
--- pep-0207.txt	5 Aug 2004 23:16:25 -0000	1.11
***************
*** 141,145 ****
      - New functions:
  
!       PyObject *PyObject_RichCompare(PyObject *, PyObject *, enum cmp_op)
  
        This performs the requested rich comparison, returning a Python
--- 141,145 ----
      - New functions:
  
!       PyObject *PyObject_RichCompare(PyObject *, PyObject *, int)
  
        This performs the requested rich comparison, returning a Python
***************
*** 147,151 ****
        Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT or Py_GE.
  
!       int PyObject_RichCompareBool(PyObject *, PyObject *, enum cmp_op)
  
        This performs the requested rich comparison, returning a
--- 147,151 ----
        Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT or Py_GE.
  
!       int PyObject_RichCompareBool(PyObject *, PyObject *, int)
  
        This performs the requested rich comparison, returning a
***************
*** 169,173 ****
        tp_richcompare slot is being used, but the other may have a
        different type.  If the function cannot compare the particular
!       combination of objects, it should return PyExc_NotImplemented.
  
      - PyObject_Compare() is changed to try rich comparisons if they
--- 169,174 ----
        tp_richcompare slot is being used, but the other may have a
        different type.  If the function cannot compare the particular
!       combination of objects, it should return a new reference to
!       Py_NotImplemented.
  
      - PyObject_Compare() is changed to try rich comparisons if they



More information about the Python-checkins mailing list