]> granicus.if.org Git - python/commitdiff
Issue #4910, patch 3/3: rename nb_long to nb_reserved
authorMark Dickinson <dickinsm@gmail.com>
Sat, 17 Jan 2009 10:04:45 +0000 (10:04 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sat, 17 Jan 2009 10:04:45 +0000 (10:04 +0000)
12 files changed:
Doc/c-api/typeobj.rst
Include/object.h
Misc/NEWS
Modules/datetimemodule.c
Objects/boolobject.c
Objects/complexobject.c
Objects/floatobject.c
Objects/longobject.c
Objects/setobject.c
Objects/typeobject.c
Objects/weakrefobject.c
PC/winreg.c

index 83559862512bc5d80033138fede8658aff1e5491..a7ba660740512196d3f7e1ecb6571f5a6e7378be 100644 (file)
@@ -1057,7 +1057,7 @@ Number Object Structures
             binaryfunc nb_xor;
             binaryfunc nb_or;
             unaryfunc nb_int;
-            unaryfunc nb_long;
+            void *nb_reserved;
             unaryfunc nb_float;
 
             binaryfunc nb_inplace_add;
@@ -1088,6 +1088,12 @@ Number Object Structures
       ``Py_NotImplemented``, if another error occurred they must return ``NULL``
       and set an exception.
 
+   .. note::
+
+      The :cdata:`nb_reserved` field should always be ``NULL``.  It
+      was previously called :cdata:`nb_long`, and was renamed in
+      Python 3.0.1.
+
 
 .. _mapping-structs:
 
index f3fdbda44d98b92b8a6f887785023348444cce44..b1391ca3a005fa8e3f2a1ab58554f70bcc1d0409 100644 (file)
@@ -219,7 +219,7 @@ typedef struct {
        binaryfunc nb_xor;
        binaryfunc nb_or;
        unaryfunc nb_int;
-       unaryfunc nb_long;
+       void *nb_reserved;  /* the slot formerly known as nb_long */
        unaryfunc nb_float;
 
        binaryfunc nb_inplace_add;
index 28cd6b6d8f5f6cfa8054e624f2733e842b785841..69c42d27b3f85aadb2e7177dab571886af431020 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 3.1 alpha 0
 Core and Builtins
 -----------------
 
+- Issue #4910: Rename nb_long slot to nb_reserved, and change its
+  type to (void *).
+
 - Issue #4935: The overflow checking code in the expandtabs() method common
   to str, bytes and bytearray could be optimized away by the compiler, letting
   the interpreter segfault instead of raising an error.
index 702b6b984bb4390f4b38769ae8b26494aeea3d87..98ae2bd2244f552c9c93883f0121a7c4c1146c42 100644 (file)
@@ -2111,7 +2111,7 @@ static PyNumberMethods delta_as_number = {
        0,                                      /*nb_xor*/
        0,                                      /*nb_or*/
        0,                                      /*nb_int*/
-       0,                                      /*nb_long*/
+       0,                                      /*nb_reserved*/
        0,                                      /*nb_float*/
        0,                                      /*nb_inplace_add*/
        0,                                      /*nb_inplace_subtract*/
index 6916b9f8035f7c2beacd14e6cd2a223013818480..eac31b994352e7f64da8602c156da5d73a5a2e5c 100644 (file)
@@ -109,7 +109,7 @@ static PyNumberMethods bool_as_number = {
        bool_xor,               /* nb_xor */
        bool_or,                /* nb_or */
        0,                      /* nb_int */
-       0,                      /* nb_long */
+       0,                      /* nb_reserved */
        0,                      /* nb_float */
        0,                      /* nb_inplace_add */
        0,                      /* nb_inplace_subtract */
index a7fd7dc558358e6ba7e6a47bf59f24b1881a836a..879d71c5652756602f7fc6041daa428c6f0460ac 100644 (file)
@@ -1060,7 +1060,7 @@ static PyNumberMethods complex_as_number = {
        0,                                      /* nb_xor */
        0,                                      /* nb_or */
        complex_int,                            /* nb_int */
-       0,                                      /* nb_long */
+       0,                                      /* nb_reserved */
        complex_float,                          /* nb_float */
        0,                                      /* nb_inplace_add */
        0,                                      /* nb_inplace_subtract */
index 7292ca568977ee1a244e99c6ef07fd97731d22b3..a3c4e45548388ab22332054eb816f59f7f7193c4 100644 (file)
@@ -1798,7 +1798,7 @@ static PyNumberMethods float_as_number = {
        0,              /*nb_xor*/
        0,              /*nb_or*/
        float_trunc,    /*nb_int*/
-       0,              /*nb_long*/
+       0,              /*nb_reserved*/
        float_float,    /*nb_float*/
        0,              /* nb_inplace_add */
        0,              /* nb_inplace_subtract */
index 259f7c57a04f1f91226638b6702e99fbc9b11c32..b7ba7960ea0d1bc25d4b51f3ddb1ad37256852d7 100644 (file)
@@ -3830,7 +3830,7 @@ static PyNumberMethods long_as_number = {
                        long_xor,       /*nb_xor*/
                        long_or,        /*nb_or*/
                        long_long,      /*nb_int*/
-       0,                              /*nb_long*/
+       0,                              /*nb_reserved*/
                        long_float,     /*nb_float*/
        0,                              /* nb_inplace_add */
        0,                              /* nb_inplace_subtract */
index d3243dd77a3c77cfa21ae04486e9110b55539fb6..d5d96cad03eb2fb02d430473874ab17db4f05225 100644 (file)
@@ -2082,7 +2082,7 @@ static PyNumberMethods set_as_number = {
        (binaryfunc)set_xor,            /*nb_xor*/
        (binaryfunc)set_or,             /*nb_or*/
        0,                              /*nb_int*/
-       0,                              /*nb_long*/
+       0,                              /*nb_reserved*/
        0,                              /*nb_float*/
        0,                              /*nb_inplace_add*/
        (binaryfunc)set_isub,           /*nb_inplace_subtract*/
index 8921b5fd189699ad43b85d5085bedc42059679fc..b02f108e198c88b717b70c8698a50a138b658d93 100644 (file)
@@ -3602,7 +3602,6 @@ inherit_slots(PyTypeObject *type, PyTypeObject *base)
                COPYNUM(nb_xor);
                COPYNUM(nb_or);
                COPYNUM(nb_int);
-               COPYNUM(nb_long);
                COPYNUM(nb_float);
                COPYNUM(nb_inplace_add);
                COPYNUM(nb_inplace_subtract);
@@ -4827,7 +4826,6 @@ SLOT1BIN(slot_nb_xor, nb_xor, "__xor__", "__rxor__")
 SLOT1BIN(slot_nb_or, nb_or, "__or__", "__ror__")
 
 SLOT0(slot_nb_int, "__int__")
-SLOT0(slot_nb_long, "__long__")
 SLOT0(slot_nb_float, "__float__")
 SLOT1(slot_nb_inplace_add, "__iadd__", PyObject *, "O")
 SLOT1(slot_nb_inplace_subtract, "__isub__", PyObject *, "O")
@@ -5443,8 +5441,6 @@ static slotdef slotdefs[] = {
        RBINSLOT("__ror__", nb_or, slot_nb_or, "|"),
        UNSLOT("__int__", nb_int, slot_nb_int, wrap_unaryfunc,
               "int(x)"),
-       UNSLOT("__long__", nb_long, slot_nb_long, wrap_unaryfunc,
-              "int(x)"),
        UNSLOT("__float__", nb_float, slot_nb_float, wrap_unaryfunc,
               "float(x)"),
        NBSLOT("__index__", nb_index, slot_nb_index, wrap_unaryfunc, 
index 538b21cbf49b200e56ce122cc316b4bad68e785c..b65e5fdd34d4b9702245c15e8f28e89d8be53315 100644 (file)
@@ -594,7 +594,7 @@ static PyNumberMethods proxy_as_number = {
     proxy_xor,              /*nb_xor*/
     proxy_or,               /*nb_or*/
     proxy_int,              /*nb_int*/
-    0,                      /*nb_long*/
+    0,                      /*nb_reserved*/
     proxy_float,            /*nb_float*/
     proxy_iadd,             /*nb_inplace_add*/
     proxy_isub,             /*nb_inplace_subtract*/
index 7316fcd94e55bf6393e53b7e65affb65b99948ec..3abefa8437e3585051c88326b453dae39be7ce28 100644 (file)
@@ -451,7 +451,7 @@ static PyNumberMethods PyHKEY_NumberMethods =
        PyHKEY_binaryFailureFunc,       /* nb_xor */
        PyHKEY_binaryFailureFunc,       /* nb_or */
        PyHKEY_intFunc,                 /* nb_int */
-       0,                              /* nb_long */
+       0,                              /* nb_reserved */
        PyHKEY_unaryFailureFunc,        /* nb_float */
 };