Skip to content

Commit

Permalink
Issue python#1717: rename tp_compare to tp_reserved. I'll change the
Browse files Browse the repository at this point in the history
type of tp_compare in a separate commit, for ease of reversion
should things go wrong.
  • Loading branch information
mdickinson committed Feb 2, 2009
1 parent 438cecd commit e94c679
Show file tree
Hide file tree
Showing 99 changed files with 215 additions and 216 deletions.
2 changes: 1 addition & 1 deletion Include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ typedef struct _typeobject {
printfunc tp_print;
getattrfunc tp_getattr;
setattrfunc tp_setattr;
cmpfunc tp_compare;
cmpfunc tp_reserved;
reprfunc tp_repr;

/* Method suites for standard classes */
Expand Down
5 changes: 2 additions & 3 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ Core and Builtins

- Issue #1717: Removed builtin cmp() function, dropped tp_compare
slot, the C API functions PyObject_Compare and PyUnicode_Compare and
the type definition cmpfunc. The tp_compare slot is reserved for
future usage. An attempt to initialize a type with a nonzero
tp_compare slot will raise TypeError.
the type definition cmpfunc. The tp_compare slot has been renamed
to tp_reserved, and is reserved for future usage.

- Issue #4707: round(x, n) now returns an integer if x is an integer.
Previously it returned a float.
Expand Down
2 changes: 1 addition & 1 deletion Modules/_bytesio.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ static PyTypeObject BytesIO_Type = {
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_reserved*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
Expand Down
8 changes: 4 additions & 4 deletions Modules/_collectionsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ static PyTypeObject deque_type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
deque_repr, /* tp_repr */
0, /* tp_as_number */
&deque_as_sequence, /* tp_as_sequence */
Expand Down Expand Up @@ -978,7 +978,7 @@ static PyTypeObject dequeiter_type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down Expand Up @@ -1061,7 +1061,7 @@ static PyTypeObject dequereviter_type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down Expand Up @@ -1318,7 +1318,7 @@ static PyTypeObject defdict_type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
(reprfunc)defdict_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down
6 changes: 3 additions & 3 deletions Modules/_csv.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ static PyTypeObject Dialect_Type = {
(printfunc)0, /* tp_print */
(getattrfunc)0, /* tp_getattr */
(setattrfunc)0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
(reprfunc)0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down Expand Up @@ -864,7 +864,7 @@ static PyTypeObject Reader_Type = {
(printfunc)0, /*tp_print*/
(getattrfunc)0, /*tp_getattr*/
(setattrfunc)0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_reserved*/
(reprfunc)0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
Expand Down Expand Up @@ -1286,7 +1286,7 @@ static PyTypeObject Writer_Type = {
(printfunc)0, /*tp_print*/
(getattrfunc)0, /*tp_getattr*/
(setattrfunc)0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_reserved*/
(reprfunc)0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
Expand Down
30 changes: 15 additions & 15 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static PyTypeObject DictRemover_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down Expand Up @@ -713,7 +713,7 @@ PyTypeObject StructType_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
&CDataType_as_sequence, /* tp_as_sequence */
Expand Down Expand Up @@ -755,7 +755,7 @@ static PyTypeObject UnionType_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
&CDataType_as_sequence, /* tp_as_sequence */
Expand Down Expand Up @@ -988,7 +988,7 @@ PyTypeObject PointerType_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
&CDataType_as_sequence, /* tp_as_sequence */
Expand Down Expand Up @@ -1390,7 +1390,7 @@ PyTypeObject ArrayType_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
&CDataType_as_sequence, /* tp_as_sequence */
Expand Down Expand Up @@ -2059,7 +2059,7 @@ PyTypeObject SimpleType_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
&CDataType_as_sequence, /* tp_as_sequence */
Expand Down Expand Up @@ -2277,7 +2277,7 @@ PyTypeObject CFuncPtrType_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
&CDataType_as_sequence, /* tp_as_sequence */
Expand Down Expand Up @@ -2560,7 +2560,7 @@ PyTypeObject CData_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down Expand Up @@ -3889,7 +3889,7 @@ PyTypeObject CFuncPtr_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
(reprfunc)CFuncPtr_repr, /* tp_repr */
&CFuncPtr_as_number, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down Expand Up @@ -4032,7 +4032,7 @@ static PyTypeObject Struct_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down Expand Up @@ -4074,7 +4074,7 @@ static PyTypeObject Union_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down Expand Up @@ -4383,7 +4383,7 @@ PyTypeObject Array_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
&Array_as_sequence, /* tp_as_sequence */
Expand Down Expand Up @@ -4615,7 +4615,7 @@ static PyTypeObject Simple_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
(reprfunc)&Simple_repr, /* tp_repr */
&Simple_as_number, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down Expand Up @@ -4992,7 +4992,7 @@ PyTypeObject Pointer_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
&Pointer_as_number, /* tp_as_number */
&Pointer_as_sequence, /* tp_as_sequence */
Expand Down Expand Up @@ -5086,7 +5086,7 @@ static PyTypeObject PyComError_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_ctypes/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ PyTypeObject CThunk_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_ctypes/callproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ PyTypeObject PyCArg_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
(reprfunc)PyCArg_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_ctypes/cfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ PyTypeObject CField_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
(reprfunc)CField_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_ctypes/stgdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ PyTypeObject StgDict_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_curses_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ PyTypeObject PyCursesPanel_Type = {
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_reserved*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
Expand Down
2 changes: 1 addition & 1 deletion Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ PyTypeObject PyCursesWindow_Type = {
0, /*tp_print*/
(getattrfunc)0, /*tp_getattr*/
(setattrfunc)0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_reserved*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
Expand Down
2 changes: 1 addition & 1 deletion Modules/_dbmmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ static PyTypeObject Dbmtype = {
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_reserved*/
0, /*tp_repr*/
0, /*tp_as_number*/
&dbm_as_sequence, /*tp_as_sequence*/
Expand Down
6 changes: 3 additions & 3 deletions Modules/_elementtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ static PyTypeObject Element_Type = {
0, /* tp_print */
0, /* tp_getattr */
(setattrfunc)element_setattr, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
(reprfunc)element_repr, /* tp_repr */
0, /* tp_as_number */
&element_as_sequence, /* tp_as_sequence */
Expand Down Expand Up @@ -1803,7 +1803,7 @@ static PyTypeObject TreeBuilder_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down Expand Up @@ -2559,7 +2559,7 @@ static PyTypeObject XMLParser_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ PyTypeObject PyFileIO_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
(reprfunc)fileio_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_functoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static PyTypeObject partial_type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_gdbmmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static PyTypeObject Dbmtype = {
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_reserved*/
0, /*tp_repr*/
0, /*tp_as_number*/
&dbm_as_sequence, /*tp_as_sequence*/
Expand Down
2 changes: 1 addition & 1 deletion Modules/_hashopenssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ static PyTypeObject EVPtype = {
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_reserved*/
(reprfunc)EVP_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
Expand Down
2 changes: 1 addition & 1 deletion Modules/_lsprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ static PyTypeObject PyProfiler_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_multiprocessing/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ PyTypeObject CONNECTION_TYPE = {
/* tp_print */ 0,
/* tp_getattr */ 0,
/* tp_setattr */ 0,
/* tp_compare */ 0,
/* tp_reserved */ 0,
/* tp_repr */ (reprfunc)connection_repr,
/* tp_as_number */ 0,
/* tp_as_sequence */ 0,
Expand Down
2 changes: 1 addition & 1 deletion Modules/_multiprocessing/semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ PyTypeObject SemLockType = {
/* tp_print */ 0,
/* tp_getattr */ 0,
/* tp_setattr */ 0,
/* tp_compare */ 0,
/* tp_reserved */ 0,
/* tp_repr */ 0,
/* tp_as_number */ 0,
/* tp_as_sequence */ 0,
Expand Down
4 changes: 2 additions & 2 deletions Modules/_pickle.c
Original file line number Diff line number Diff line change
Expand Up @@ -2677,7 +2677,7 @@ static PyTypeObject Pickler_Type = {
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_reserved*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
Expand Down Expand Up @@ -4534,7 +4534,7 @@ static PyTypeObject Unpickler_Type = {
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_reserved*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
Expand Down
Loading

0 comments on commit e94c679

Please sign in to comment.