Remove nb_reserved (nb_coerce), nb_hex, and nb_oct from PyNumberMethods
authorBenjamin Peterson <benjamin@python.org>
Wed, 11 Jun 2008 20:21:57 +0000 (20:21 +0000)
committerBenjamin Peterson <benjamin@python.org>
Wed, 11 Jun 2008 20:21:57 +0000 (20:21 +0000)
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/weakrefobject.c
PC/winreg.c

index 8ea61b024d5f6850cc53d47f6d90fa2a6f8aea13..8031c10f8a45e39eab39ee852ff2e065067a25e8 100644 (file)
@@ -1049,13 +1049,9 @@ Number Object Structures
             binaryfunc nb_and;
             binaryfunc nb_xor;
             binaryfunc nb_or;
-            int nb_reserved;  /* unused, must be zero */
             unaryfunc nb_int;
             unaryfunc nb_long;
             unaryfunc nb_float;
-            
-            unaryfunc nb_oct; /* not used anymore, must be zero */
-            unaryfunc nb_hex; /* not used anymore, must be zero */
 
             binaryfunc nb_inplace_add;
             binaryfunc nb_inplace_subtract;
index 2a7075f3be384df09433db8b406bd41326e164c5..1e929750f88b34d9cd434e03deeea4d8f3922e42 100644 (file)
@@ -215,13 +215,9 @@ typedef struct {
        binaryfunc nb_and;
        binaryfunc nb_xor;
        binaryfunc nb_or;
-       int nb_reserved; /* unused, used to be nb_coerce */
        unaryfunc nb_int;
        unaryfunc nb_long;
        unaryfunc nb_float;
-       /* NB: nb_oct and nb_hex are not used anymore. */
-       unaryfunc nb_oct;
-       unaryfunc nb_hex;
 
        binaryfunc nb_inplace_add;
        binaryfunc nb_inplace_subtract;
index 5d29093bc9789b9eda209d17b60a67947daa4230..17fe5982b532db5dffd87ab172a18da802d14fe3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -60,6 +60,9 @@ Core and Builtins
   f_exc_type, f_exc_value, and f_exc_traceback cannot be accessed from Python
   code anymore.
 
+- Three of PyNumberMethods' members, nb_coerce, nb_hex, and nb_oct, have been
+  removed.
+
 Extension Modules
 -----------------
 
index 7d44b249d6377f84454dbfdfe50c8fc6b75ec195..6c2d5a057f629f9a18b5f7450a7acc73b2a0aab3 100644 (file)
@@ -2103,12 +2103,9 @@ static PyNumberMethods delta_as_number = {
        0,                                      /*nb_and*/
        0,                                      /*nb_xor*/
        0,                                      /*nb_or*/
-       0,                                      /*nb_reserved*/
        0,                                      /*nb_int*/
        0,                                      /*nb_long*/
        0,                                      /*nb_float*/
-       0,                                      /*nb_oct*/
-       0,                                      /*nb_hex*/
        0,                                      /*nb_inplace_add*/
        0,                                      /*nb_inplace_subtract*/
        0,                                      /*nb_inplace_multiply*/
index dfea7f44ac7a88f5f2c27f6e1f3f3e94a7b406f3..59a66d52601f378e7dcc4c7088e2d4918c1f997a 100644 (file)
@@ -108,12 +108,9 @@ static PyNumberMethods bool_as_number = {
        bool_and,               /* nb_and */
        bool_xor,               /* nb_xor */
        bool_or,                /* nb_or */
-       0,                      /* nb_reserved */
        0,                      /* nb_int */
        0,                      /* nb_long */
        0,                      /* nb_float */
-       0,                      /* nb_oct */
-       0,                      /* nb_hex */
        0,                      /* nb_inplace_add */
        0,                      /* nb_inplace_subtract */
        0,                      /* nb_inplace_multiply */
index 2e501fc0c5f1d69a98ee2040168633969f556187..75283a0236f8245b493e49343c447a1331ca3e87 100644 (file)
@@ -1067,12 +1067,9 @@ static PyNumberMethods complex_as_number = {
        0,                                      /* nb_and */
        0,                                      /* nb_xor */
        0,                                      /* nb_or */
-       0,                                      /* nb_reserved */
        complex_int,                            /* nb_int */
        complex_long,                           /* nb_long */
        complex_float,                          /* nb_float */
-       0,                                      /* nb_oct */
-       0,                                      /* nb_hex */
        0,                                      /* nb_inplace_add */
        0,                                      /* nb_inplace_subtract */
        0,                                      /* nb_inplace_multiply*/
index dd3ea938ffc360a172ce24dfbebf6872d40dbe42..db1c99f687ec4c85d0327fc278118a39660eb519 100644 (file)
@@ -1381,12 +1381,9 @@ static PyNumberMethods float_as_number = {
        0,              /*nb_and*/
        0,              /*nb_xor*/
        0,              /*nb_or*/
-       0,              /*nb_reserved*/
        float_trunc,    /*nb_int*/
        float_trunc,    /*nb_long*/
        float_float,    /*nb_float*/
-       0,              /* nb_oct */
-       0,              /* nb_hex */
        0,              /* nb_inplace_add */
        0,              /* nb_inplace_subtract */
        0,              /* nb_inplace_multiply */
index d0d4d3aae416d2050177125a800db7d534e27e9d..d1c27e6b69a1c47245fb7220013643bf4fac9225 100644 (file)
@@ -3713,12 +3713,9 @@ static PyNumberMethods long_as_number = {
                        long_and,       /*nb_and*/
                        long_xor,       /*nb_xor*/
                        long_or,        /*nb_or*/
-                       0,              /*nb_reserved*/
                        long_long,      /*nb_int*/
                        long_long,      /*nb_long*/
                        long_float,     /*nb_float*/
-                       0,              /*nb_oct*/ /* not used */
-                       0,              /*nb_hex*/ /* not used */
        0,                              /* nb_inplace_add */
        0,                              /* nb_inplace_subtract */
        0,                              /* nb_inplace_multiply */
index 4456ef49d5083842bcb872461112aecec6e9fa2f..e5c89e5d35f6fc394c99501e26d3a83ab1b664d9 100644 (file)
@@ -2015,12 +2015,9 @@ static PyNumberMethods set_as_number = {
        (binaryfunc)set_and,            /*nb_and*/
        (binaryfunc)set_xor,            /*nb_xor*/
        (binaryfunc)set_or,             /*nb_or*/
-       0,                              /*nb_reserved*/
        0,                              /*nb_int*/
        0,                              /*nb_long*/
        0,                              /*nb_float*/
-       0,                              /*nb_oct*/
-       0,                              /*nb_hex*/
        0,                              /*nb_inplace_add*/
        (binaryfunc)set_isub,           /*nb_inplace_subtract*/
        0,                              /*nb_inplace_multiply*/
index 2f86ae8ad89d59164aaa2340d259b0d0deba1d4b..040e93810ddd2b60d6a4d5d23135feee3ec6bd9e 100644 (file)
@@ -594,12 +594,9 @@ static PyNumberMethods proxy_as_number = {
     proxy_and,              /*nb_and*/
     proxy_xor,              /*nb_xor*/
     proxy_or,               /*nb_or*/
-    0,                      /*nb_reserved*/
     proxy_int,              /*nb_int*/
     proxy_long,             /*nb_long*/
     proxy_float,            /*nb_float*/
-    0,                      /*nb_oct*/
-    0,                      /*nb_hex*/
     proxy_iadd,             /*nb_inplace_add*/
     proxy_isub,             /*nb_inplace_subtract*/
     proxy_imul,             /*nb_inplace_multiply*/
index d0397e99842f217ac67580bd89622f09eb269179..571209fdff5b42aaac8efa8a9009906120932d9f 100644 (file)
@@ -450,12 +450,9 @@ static PyNumberMethods PyHKEY_NumberMethods =
        PyHKEY_binaryFailureFunc,       /* nb_and */
        PyHKEY_binaryFailureFunc,       /* nb_xor */
        PyHKEY_binaryFailureFunc,       /* nb_or */
-       0,                              /* nb_reserved */
        PyHKEY_intFunc,                 /* nb_int */
        PyHKEY_unaryFailureFunc,        /* nb_long */
        PyHKEY_unaryFailureFunc,        /* nb_float */
-       PyHKEY_unaryFailureFunc,        /* nb_oct */
-       PyHKEY_unaryFailureFunc,        /* nb_hex */
 };