Remove nb_reserved (nb_coerce), nb_hex, and nb_oct from PyNumberMethods

This commit is contained in:
Benjamin Peterson 2008-06-11 20:21:57 +00:00
parent 624a7893ea
commit 4f92ca4022
11 changed files with 3 additions and 32 deletions

View 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;

View 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;

View File

@ -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
-----------------

View 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*/

View 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 */

View 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*/

View 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 */

View 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 */

View 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*/

View 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*/

View 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 */
};