PyNumberMethods

For numbers without flag bit Py_TPFLAGS_CHECKTYPES set, all arguments are guaranteed to be of the object's type (modulo coercion hacks -- i.e. if the type's coercion function returns other types, then these are allowed as well). Numbers that have the Py_TPFLAGS_CHECKTYPES flag bit set should check *both* arguments for proper type and implement the necessary conversions in the slot functions themselves.

Members

Variables

nb_absolute
unaryfunc nb_absolute;
Undocumented in source.
nb_add
binaryfunc nb_add;
Undocumented in source.
nb_and
binaryfunc nb_and;
Undocumented in source.
nb_bool
inquiry nb_bool;
Undocumented in source.
nb_coerce
coercion nb_coerce;
Undocumented in source.
nb_divide
binaryfunc nb_divide;
Undocumented in source.
nb_divmod
binaryfunc nb_divmod;
Undocumented in source.
nb_float
unaryfunc nb_float;
Undocumented in source.
nb_floor_divide
binaryfunc nb_floor_divide;

These require the Py_TPFLAGS_HAVE_CLASS flag

nb_hex
unaryfunc nb_hex;
Undocumented in source.
nb_index
unaryfunc nb_index;

Availability: >= 2.5

nb_inplace_add
binaryfunc nb_inplace_add;
Undocumented in source.
nb_inplace_and
binaryfunc nb_inplace_and;
Undocumented in source.
nb_inplace_divide
binaryfunc nb_inplace_divide;
Undocumented in source.
nb_inplace_floor_divide
binaryfunc nb_inplace_floor_divide;

These require the Py_TPFLAGS_HAVE_CLASS flag

nb_inplace_lshift
binaryfunc nb_inplace_lshift;
Undocumented in source.
nb_inplace_matrix_multiply
binaryfunc nb_inplace_matrix_multiply;
Undocumented in source.
nb_inplace_multiply
binaryfunc nb_inplace_multiply;
Undocumented in source.
nb_inplace_or
binaryfunc nb_inplace_or;
Undocumented in source.
nb_inplace_power
ternaryfunc nb_inplace_power;
Undocumented in source.
nb_inplace_remainder
binaryfunc nb_inplace_remainder;
Undocumented in source.
nb_inplace_rshift
binaryfunc nb_inplace_rshift;
Undocumented in source.
nb_inplace_subtract
binaryfunc nb_inplace_subtract;
Undocumented in source.
nb_inplace_true_divide
binaryfunc nb_inplace_true_divide;

These require the Py_TPFLAGS_HAVE_CLASS flag

nb_inplace_xor
binaryfunc nb_inplace_xor;
Undocumented in source.
nb_int
unaryfunc nb_int;
Undocumented in source.
nb_invert
unaryfunc nb_invert;
Undocumented in source.
nb_long
unaryfunc nb_long;
Undocumented in source.
nb_lshift
binaryfunc nb_lshift;
Undocumented in source.
nb_matrix_multiply
binaryfunc nb_matrix_multiply;
Undocumented in source.
nb_multiply
binaryfunc nb_multiply;
Undocumented in source.
nb_negative
unaryfunc nb_negative;
Undocumented in source.
nb_nonzero
inquiry nb_nonzero;
Undocumented in source.
nb_oct
unaryfunc nb_oct;
Undocumented in source.
nb_or
binaryfunc nb_or;
Undocumented in source.
nb_positive
unaryfunc nb_positive;
Undocumented in source.
nb_power
ternaryfunc nb_power;
Undocumented in source.
nb_remainder
binaryfunc nb_remainder;
Undocumented in source.
nb_reserved
void* nb_reserved;
Undocumented in source.
nb_rshift
binaryfunc nb_rshift;
Undocumented in source.
nb_subtract
binaryfunc nb_subtract;
Undocumented in source.
nb_true_divide
binaryfunc nb_true_divide;

These require the Py_TPFLAGS_HAVE_CLASS flag

nb_xor
binaryfunc nb_xor;
Undocumented in source.

Meta