/* Arithmetic methods -- only so we can override &, |, ^. */
static PyNumberMethods bool_as_number = {
- 0, /* nb_add */
- 0, /* nb_subtract */
- 0, /* nb_multiply */
- 0, /* nb_divide */
- 0, /* nb_remainder */
- 0, /* nb_divmod */
- 0, /* nb_power */
- 0, /* nb_negative */
- 0, /* nb_positive */
- 0, /* nb_absolute */
- 0, /* nb_nonzero */
- 0, /* nb_invert */
- 0, /* nb_lshift */
- 0, /* nb_rshift */
- (binaryfunc)bool_and, /* nb_and */
- (binaryfunc)bool_xor, /* nb_xor */
- (binaryfunc)bool_or, /* nb_or */
- 0, /* nb_coerce */
- 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 */
- 0, /* nb_inplace_divide */
- 0, /* nb_inplace_remainder */
- 0, /* nb_inplace_power */
- 0, /* nb_inplace_lshift */
- 0, /* nb_inplace_rshift */
- 0, /* nb_inplace_and */
- 0, /* nb_inplace_xor */
- 0, /* nb_inplace_or */
- 0, /* nb_floor_divide */
- 0, /* nb_true_divide */
- 0, /* nb_inplace_floor_divide */
- 0, /* nb_inplace_true_divide */
+ 0, /* nb_add */
+ 0, /* nb_subtract */
+ 0, /* nb_multiply */
+ 0, /* nb_divide */
+ 0, /* nb_remainder */
+ 0, /* nb_divmod */
+ 0, /* nb_power */
+ 0, /* nb_negative */
+ 0, /* nb_positive */
+ 0, /* nb_absolute */
+ 0, /* nb_nonzero */
+ 0, /* nb_invert */
+ 0, /* nb_lshift */
+ 0, /* nb_rshift */
+ bool_and, /* nb_and */
+ bool_xor, /* nb_xor */
+ bool_or, /* nb_or */
+ 0, /* nb_coerce */
+ 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 */
+ 0, /* nb_inplace_divide */
+ 0, /* nb_inplace_remainder */
+ 0, /* nb_inplace_power */
+ 0, /* nb_inplace_lshift */
+ 0, /* nb_inplace_rshift */
+ 0, /* nb_inplace_and */
+ 0, /* nb_inplace_xor */
+ 0, /* nb_inplace_or */
+ 0, /* nb_floor_divide */
+ 0, /* nb_true_divide */
+ 0, /* nb_inplace_floor_divide */
+ 0, /* nb_inplace_true_divide */
};
/* The type object for bool. Note that this cannot be subclassed! */
static PyNumberMethods instance_as_number = {
- (binaryfunc)instance_add, /* nb_add */
- (binaryfunc)instance_sub, /* nb_subtract */
- (binaryfunc)instance_mul, /* nb_multiply */
- (binaryfunc)instance_div, /* nb_divide */
- (binaryfunc)instance_mod, /* nb_remainder */
- (binaryfunc)instance_divmod, /* nb_divmod */
- (ternaryfunc)instance_pow, /* nb_power */
- (unaryfunc)instance_neg, /* nb_negative */
- (unaryfunc)instance_pos, /* nb_positive */
- (unaryfunc)instance_abs, /* nb_absolute */
- (inquiry)instance_nonzero, /* nb_nonzero */
- (unaryfunc)instance_invert, /* nb_invert */
- (binaryfunc)instance_lshift, /* nb_lshift */
- (binaryfunc)instance_rshift, /* nb_rshift */
- (binaryfunc)instance_and, /* nb_and */
- (binaryfunc)instance_xor, /* nb_xor */
- (binaryfunc)instance_or, /* nb_or */
- (coercion)instance_coerce, /* nb_coerce */
- (unaryfunc)instance_int, /* nb_int */
- (unaryfunc)instance_long, /* nb_long */
- (unaryfunc)instance_float, /* nb_float */
- (unaryfunc)instance_oct, /* nb_oct */
- (unaryfunc)instance_hex, /* nb_hex */
- (binaryfunc)instance_iadd, /* nb_inplace_add */
- (binaryfunc)instance_isub, /* nb_inplace_subtract */
- (binaryfunc)instance_imul, /* nb_inplace_multiply */
- (binaryfunc)instance_idiv, /* nb_inplace_divide */
- (binaryfunc)instance_imod, /* nb_inplace_remainder */
- (ternaryfunc)instance_ipow, /* nb_inplace_power */
- (binaryfunc)instance_ilshift, /* nb_inplace_lshift */
- (binaryfunc)instance_irshift, /* nb_inplace_rshift */
- (binaryfunc)instance_iand, /* nb_inplace_and */
- (binaryfunc)instance_ixor, /* nb_inplace_xor */
- (binaryfunc)instance_ior, /* nb_inplace_or */
- (binaryfunc)instance_floordiv, /* nb_floor_divide */
- (binaryfunc)instance_truediv, /* nb_true_divide */
- (binaryfunc)instance_ifloordiv, /* nb_inplace_floor_divide */
- (binaryfunc)instance_itruediv, /* nb_inplace_true_divide */
- (lenfunc)instance_index, /* nb_index */
+ instance_add, /* nb_add */
+ instance_sub, /* nb_subtract */
+ instance_mul, /* nb_multiply */
+ instance_div, /* nb_divide */
+ instance_mod, /* nb_remainder */
+ instance_divmod, /* nb_divmod */
+ instance_pow, /* nb_power */
+ (unaryfunc)instance_neg, /* nb_negative */
+ (unaryfunc)instance_pos, /* nb_positive */
+ (unaryfunc)instance_abs, /* nb_absolute */
+ (inquiry)instance_nonzero, /* nb_nonzero */
+ (unaryfunc)instance_invert, /* nb_invert */
+ instance_lshift, /* nb_lshift */
+ instance_rshift, /* nb_rshift */
+ instance_and, /* nb_and */
+ instance_xor, /* nb_xor */
+ instance_or, /* nb_or */
+ instance_coerce, /* nb_coerce */
+ (unaryfunc)instance_int, /* nb_int */
+ (unaryfunc)instance_long, /* nb_long */
+ (unaryfunc)instance_float, /* nb_float */
+ (unaryfunc)instance_oct, /* nb_oct */
+ (unaryfunc)instance_hex, /* nb_hex */
+ instance_iadd, /* nb_inplace_add */
+ instance_isub, /* nb_inplace_subtract */
+ instance_imul, /* nb_inplace_multiply */
+ instance_idiv, /* nb_inplace_divide */
+ instance_imod, /* nb_inplace_remainder */
+ instance_ipow, /* nb_inplace_power */
+ instance_ilshift, /* nb_inplace_lshift */
+ instance_irshift, /* nb_inplace_rshift */
+ instance_iand, /* nb_inplace_and */
+ instance_ixor, /* nb_inplace_xor */
+ instance_ior, /* nb_inplace_or */
+ instance_floordiv, /* nb_floor_divide */
+ instance_truediv, /* nb_true_divide */
+ instance_ifloordiv, /* nb_inplace_floor_divide */
+ instance_itruediv, /* nb_inplace_true_divide */
+ (lenfunc)instance_index, /* nb_index */
};
PyTypeObject PyInstance_Type = {
(hashfunc)instancemethod_hash, /* tp_hash */
instancemethod_call, /* tp_call */
0, /* tp_str */
- (getattrofunc)instancemethod_getattro, /* tp_getattro */
+ instancemethod_getattro, /* tp_getattro */
PyObject_GenericSetAttr, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_WEAKREFS, /* tp_flags */
PyTypeObject PyCObject_Type = {
PyObject_HEAD_INIT(&PyType_Type)
- 0, /*ob_size*/
- "PyCObject", /*tp_name*/
- sizeof(PyCObject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
+ 0, /*ob_size*/
+ "PyCObject", /*tp_name*/
+ sizeof(PyCObject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
/* methods */
- (destructor)PyCObject_dealloc, /*tp_dealloc*/
- (printfunc)0, /*tp_print*/
- (getattrfunc)0, /*tp_getattr*/
- (setattrfunc)0, /*tp_setattr*/
- (cmpfunc)0, /*tp_compare*/
- (reprfunc)0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- (hashfunc)0, /*tp_hash*/
- (ternaryfunc)0, /*tp_call*/
- (reprfunc)0, /*tp_str*/
-
- /* Space for future expansion */
- 0L,0L,0L,0L,
- PyCObject_Type__doc__ /* Documentation string */
+ (destructor)PyCObject_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ 0, /*tp_compare*/
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ 0, /*tp_flags*/
+ PyCObject_Type__doc__ /*tp_doc*/
};
0, /* nb_and */
0, /* nb_xor */
0, /* nb_or */
- (coercion)complex_coerce, /* nb_coerce */
- (unaryfunc)complex_int, /* nb_int */
- (unaryfunc)complex_long, /* nb_long */
- (unaryfunc)complex_float, /* nb_float */
+ complex_coerce, /* nb_coerce */
+ complex_int, /* nb_int */
+ complex_long, /* nb_long */
+ complex_float, /* nb_float */
0, /* nb_oct */
0, /* nb_hex */
0, /* nb_inplace_add */
"complex",
sizeof(PyComplexObject),
0,
- (destructor)complex_dealloc, /* tp_dealloc */
+ complex_dealloc, /* tp_dealloc */
(printfunc)complex_print, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
- (ternaryfunc)0, /* tp_call */
+ 0, /* tp_call */
0, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
- (ternaryfunc)0, /* tp_call */
+ 0, /* tp_call */
0, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
/* Hack to implement "key in dict" */
static PySequenceMethods dict_as_sequence = {
- 0, /* sq_length */
- 0, /* sq_concat */
- 0, /* sq_repeat */
- 0, /* sq_item */
- 0, /* sq_slice */
- 0, /* sq_ass_item */
- 0, /* sq_ass_slice */
- (objobjproc)PyDict_Contains, /* sq_contains */
- 0, /* sq_inplace_concat */
- 0, /* sq_inplace_repeat */
+ 0, /* sq_length */
+ 0, /* sq_concat */
+ 0, /* sq_repeat */
+ 0, /* sq_item */
+ 0, /* sq_slice */
+ 0, /* sq_ass_item */
+ 0, /* sq_ass_slice */
+ PyDict_Contains, /* sq_contains */
+ 0, /* sq_inplace_concat */
+ 0, /* sq_inplace_repeat */
};
static PyObject *
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
Py_TPFLAGS_BASETYPE, /* tp_flags */
dictionary_doc, /* tp_doc */
- (traverseproc)dict_traverse, /* tp_traverse */
- (inquiry)dict_tp_clear, /* tp_clear */
+ dict_traverse, /* tp_traverse */
+ dict_tp_clear, /* tp_clear */
dict_richcompare, /* tp_richcompare */
0, /* tp_weaklistoffset */
(getiterfunc)dict_iter, /* tp_iter */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
- (initproc)dict_init, /* tp_init */
+ dict_init, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
dict_new, /* tp_new */
PyObject_GC_Del, /* tp_free */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
- (initproc)file_init, /* tp_init */
+ file_init, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
file_new, /* tp_new */
PyObject_Del, /* tp_free */
static PyNumberMethods float_as_number = {
- (binaryfunc)float_add, /*nb_add*/
- (binaryfunc)float_sub, /*nb_subtract*/
- (binaryfunc)float_mul, /*nb_multiply*/
- (binaryfunc)float_classic_div, /*nb_divide*/
- (binaryfunc)float_rem, /*nb_remainder*/
- (binaryfunc)float_divmod, /*nb_divmod*/
- (ternaryfunc)float_pow, /*nb_power*/
+ float_add, /*nb_add*/
+ float_sub, /*nb_subtract*/
+ float_mul, /*nb_multiply*/
+ float_classic_div, /*nb_divide*/
+ float_rem, /*nb_remainder*/
+ float_divmod, /*nb_divmod*/
+ float_pow, /*nb_power*/
(unaryfunc)float_neg, /*nb_negative*/
(unaryfunc)float_pos, /*nb_positive*/
(unaryfunc)float_abs, /*nb_absolute*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
- (coercion)float_coerce, /*nb_coerce*/
- (unaryfunc)float_int, /*nb_int*/
- (unaryfunc)float_long, /*nb_long*/
- (unaryfunc)float_float, /*nb_float*/
+ float_coerce, /*nb_coerce*/
+ float_int, /*nb_int*/
+ float_long, /*nb_long*/
+ float_float, /*nb_float*/
0, /* nb_oct */
0, /* nb_hex */
0, /* nb_inplace_add */
float_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
- (richcmpfunc)float_richcompare, /* tp_richcompare */
+ float_richcompare, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
int_true_divide, /* nb_true_divide */
0, /* nb_inplace_floor_divide */
0, /* nb_inplace_true_divide */
- (lenfunc)PyInt_AsSsize_t, /* nb_index */
+ PyInt_AsSsize_t, /* nb_index */
};
PyTypeObject PyInt_Type = {
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
PyObject_SelfIter, /* tp_iter */
- (iternextfunc)iter_iternext, /* tp_iternext */
+ iter_iternext, /* tp_iternext */
seqiter_methods, /* tp_methods */
0, /* tp_members */
};
(binaryfunc) long_add, /*nb_add*/
(binaryfunc) long_sub, /*nb_subtract*/
(binaryfunc) long_mul, /*nb_multiply*/
- (binaryfunc) long_classic_div, /*nb_divide*/
- (binaryfunc) long_mod, /*nb_remainder*/
- (binaryfunc) long_divmod, /*nb_divmod*/
- (ternaryfunc) long_pow, /*nb_power*/
+ long_classic_div, /*nb_divide*/
+ long_mod, /*nb_remainder*/
+ long_divmod, /*nb_divmod*/
+ long_pow, /*nb_power*/
(unaryfunc) long_neg, /*nb_negative*/
(unaryfunc) long_pos, /*tp_positive*/
(unaryfunc) long_abs, /*tp_absolute*/
(inquiry) long_nonzero, /*tp_nonzero*/
(unaryfunc) long_invert, /*nb_invert*/
- (binaryfunc) long_lshift, /*nb_lshift*/
+ long_lshift, /*nb_lshift*/
(binaryfunc) long_rshift, /*nb_rshift*/
- (binaryfunc) long_and, /*nb_and*/
- (binaryfunc) long_xor, /*nb_xor*/
- (binaryfunc) long_or, /*nb_or*/
- (coercion) long_coerce, /*nb_coerce*/
- (unaryfunc) long_int, /*nb_int*/
- (unaryfunc) long_long, /*nb_long*/
- (unaryfunc) long_float, /*nb_float*/
- (unaryfunc) long_oct, /*nb_oct*/
- (unaryfunc) long_hex, /*nb_hex*/
+ long_and, /*nb_and*/
+ long_xor, /*nb_xor*/
+ long_or, /*nb_or*/
+ long_coerce, /*nb_coerce*/
+ long_int, /*nb_int*/
+ long_long, /*nb_long*/
+ long_float, /*nb_float*/
+ long_oct, /*nb_oct*/
+ long_hex, /*nb_hex*/
0, /* nb_inplace_add */
0, /* nb_inplace_subtract */
0, /* nb_inplace_multiply */
0, /* nb_inplace_and */
0, /* nb_inplace_xor */
0, /* nb_inplace_or */
- (binaryfunc)long_div, /* nb_floor_divide */
+ long_div, /* nb_floor_divide */
long_true_divide, /* nb_true_divide */
0, /* nb_inplace_floor_divide */
0, /* nb_inplace_true_divide */
- (lenfunc)long_index, /* nb_index */
+ long_index, /* nb_index */
};
PyTypeObject PyLong_Type = {
"long", /* tp_name */
sizeof(PyLongObject) - sizeof(digit), /* tp_basicsize */
sizeof(digit), /* tp_itemsize */
- (destructor)long_dealloc, /* tp_dealloc */
+ long_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)long_compare, /* tp_compare */
- (reprfunc)long_repr, /* tp_repr */
+ long_repr, /* tp_repr */
&long_as_number, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
(hashfunc)long_hash, /* tp_hash */
0, /* tp_call */
- (reprfunc)long_str, /* tp_str */
+ long_str, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
"NoneType",
0,
0,
- (destructor)none_dealloc, /*tp_dealloc*/ /*never called*/
+ none_dealloc, /*tp_dealloc*/ /*never called*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
- (reprfunc)none_repr, /*tp_repr*/
+ none_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
"NotImplementedType",
0,
0,
- (destructor)none_dealloc, /*tp_dealloc*/ /*never called*/
+ none_dealloc, /*tp_dealloc*/ /*never called*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
- (reprfunc)NotImplemented_repr, /*tp_repr*/
+ NotImplemented_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
PyTypeObject PyRange_Type = {
PyObject_HEAD_INIT(&PyType_Type)
- 0, /* Number of items for varobject */
- "xrange", /* Name of this type */
- sizeof(rangeobject), /* Basic object size */
- 0, /* Item size for varobject */
- (destructor)PyObject_Del, /* tp_dealloc */
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_compare */
- (reprfunc)range_repr, /* tp_repr */
- 0, /* tp_as_number */
- &range_as_sequence, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- PyObject_GenericGetAttr, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT, /* tp_flags */
- range_doc, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- (getiterfunc)range_iter, /* tp_iter */
- 0, /* tp_iternext */
- range_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- range_new, /* tp_new */
+ 0, /* Number of items for varobject */
+ "xrange", /* Name of this type */
+ sizeof(rangeobject), /* Basic object size */
+ 0, /* Item size for varobject */
+ (destructor)PyObject_Del, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ (reprfunc)range_repr, /* tp_repr */
+ 0, /* tp_as_number */
+ &range_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
+ range_doc, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ range_iter, /* tp_iter */
+ 0, /* tp_iternext */
+ range_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ range_new, /* tp_new */
};
/*********************** Xrange Iterator **************************/
}
static int
-set_nocmp(PyObject *self)
+set_nocmp(PyObject *self, PyObject *other)
{
PyErr_SetString(PyExc_TypeError, "cannot compare sets using cmp()");
return -1;
}
static PySequenceMethods set_as_sequence = {
- (lenfunc)set_len, /* sq_length */
+ set_len, /* sq_length */
0, /* sq_concat */
0, /* sq_repeat */
0, /* sq_item */
(printfunc)set_tp_print, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
- (cmpfunc)set_nocmp, /* tp_compare */
+ set_nocmp, /* tp_compare */
(reprfunc)set_repr, /* tp_repr */
&set_as_number, /* tp_as_number */
&set_as_sequence, /* tp_as_sequence */
(printfunc)set_tp_print, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
- (cmpfunc)set_nocmp, /* tp_compare */
+ set_nocmp, /* tp_compare */
(reprfunc)set_repr, /* tp_repr */
&frozenset_as_number, /* tp_as_number */
&set_as_sequence, /* tp_as_sequence */
static PyTypeObject PyEllipsis_Type = {
PyObject_HEAD_INIT(&PyType_Type)
- 0, /* ob_size */
- "ellipsis", /* tp_name */
- 0, /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /*never called*/ /* tp_dealloc */
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_compare */
- (reprfunc)ellipsis_repr, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- PyObject_GenericGetAttr, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT, /* tp_flags */
+ 0, /* ob_size */
+ "ellipsis", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /*never called*/ /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ ellipsis_repr, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
};
PyObject _Py_EllipsisObject = {
"str",
sizeof(PyStringObject),
sizeof(char),
- (destructor)string_dealloc, /* tp_dealloc */
+ string_dealloc, /* tp_dealloc */
(printfunc)string_print, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
- (reprfunc)string_repr, /* tp_repr */
+ string_repr, /* tp_repr */
&string_as_number, /* tp_as_number */
&string_as_sequence, /* tp_as_sequence */
&string_as_mapping, /* tp_as_mapping */
(hashfunc)string_hash, /* tp_hash */
0, /* tp_call */
- (reprfunc)string_str, /* tp_str */
+ string_str, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
&string_as_buffer, /* tp_as_buffer */
0, /* tp_as_number */
&structseq_as_sequence, /* tp_as_sequence */
0, /* tp_as_mapping */
- (hashfunc)structseq_hash, /* tp_hash */
+ structseq_hash, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
"object", /* tp_name */
sizeof(PyObject), /* tp_basicsize */
0, /* tp_itemsize */
- (destructor)object_dealloc, /* tp_dealloc */
+ object_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
/* Order is according to common usage: often used methods should
appear first, since lookup is done sequentially. */
- {"encode", (PyCFunction) unicode_encode, METH_VARARGS, encode__doc__},
+ {"encode", unicode_encode, METH_VARARGS, encode__doc__},
{"replace", (PyCFunction) unicode_replace, METH_VARARGS, replace__doc__},
{"split", (PyCFunction) unicode_split, METH_VARARGS, split__doc__},
{"rsplit", (PyCFunction) unicode_rsplit, METH_VARARGS, rsplit__doc__},
static PySequenceMethods unicode_as_sequence = {
(lenfunc) unicode_length, /* sq_length */
- (binaryfunc) PyUnicode_Concat, /* sq_concat */
+ PyUnicode_Concat, /* sq_concat */
(ssizeargfunc) unicode_repeat, /* sq_repeat */
(ssizeargfunc) unicode_getitem, /* sq_item */
(ssizessizeargfunc) unicode_slice, /* sq_slice */
0, /* sq_ass_item */
0, /* sq_ass_slice */
- (objobjproc)PyUnicode_Contains, /*sq_contains*/
+ PyUnicode_Contains, /* sq_contains */
};
#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX)
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc) unicode_compare, /* tp_compare */
- (reprfunc) unicode_repr, /* tp_repr */
+ unicode_repr, /* tp_repr */
&unicode_as_number, /* tp_as_number */
&unicode_as_sequence, /* tp_as_sequence */
&unicode_as_mapping, /* tp_as_mapping */
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
- (initproc)weakref___init__, /*tp_init*/
+ weakref___init__, /*tp_init*/
PyType_GenericAlloc, /*tp_alloc*/
weakref___new__, /*tp_new*/
PyObject_GC_Del, /*tp_free*/
static PyNumberMethods proxy_as_number = {
- (binaryfunc)proxy_add, /*nb_add*/
- (binaryfunc)proxy_sub, /*nb_subtract*/
- (binaryfunc)proxy_mul, /*nb_multiply*/
- (binaryfunc)proxy_div, /*nb_divide*/
- (binaryfunc)proxy_mod, /*nb_remainder*/
- (binaryfunc)proxy_divmod, /*nb_divmod*/
- (ternaryfunc)proxy_pow, /*nb_power*/
- (unaryfunc)proxy_neg, /*nb_negative*/
- (unaryfunc)proxy_pos, /*nb_positive*/
- (unaryfunc)proxy_abs, /*nb_absolute*/
- (inquiry)proxy_nonzero, /*nb_nonzero*/
- (unaryfunc)proxy_invert, /*nb_invert*/
- (binaryfunc)proxy_lshift, /*nb_lshift*/
- (binaryfunc)proxy_rshift, /*nb_rshift*/
- (binaryfunc)proxy_and, /*nb_and*/
- (binaryfunc)proxy_xor, /*nb_xor*/
- (binaryfunc)proxy_or, /*nb_or*/
- (coercion)0, /*nb_coerce*/
- (unaryfunc)proxy_int, /*nb_int*/
- (unaryfunc)proxy_long, /*nb_long*/
- (unaryfunc)proxy_float, /*nb_float*/
- (unaryfunc)0, /*nb_oct*/
- (unaryfunc)0, /*nb_hex*/
- (binaryfunc)proxy_iadd, /*nb_inplace_add*/
- (binaryfunc)proxy_isub, /*nb_inplace_subtract*/
- (binaryfunc)proxy_imul, /*nb_inplace_multiply*/
- (binaryfunc)proxy_idiv, /*nb_inplace_divide*/
- (binaryfunc)proxy_imod, /*nb_inplace_remainder*/
- (ternaryfunc)proxy_ipow, /*nb_inplace_power*/
- (binaryfunc)proxy_ilshift, /*nb_inplace_lshift*/
- (binaryfunc)proxy_irshift, /*nb_inplace_rshift*/
- (binaryfunc)proxy_iand, /*nb_inplace_and*/
- (binaryfunc)proxy_ixor, /*nb_inplace_xor*/
- (binaryfunc)proxy_ior, /*nb_inplace_or*/
+ proxy_add, /*nb_add*/
+ proxy_sub, /*nb_subtract*/
+ proxy_mul, /*nb_multiply*/
+ proxy_div, /*nb_divide*/
+ proxy_mod, /*nb_remainder*/
+ proxy_divmod, /*nb_divmod*/
+ proxy_pow, /*nb_power*/
+ proxy_neg, /*nb_negative*/
+ proxy_pos, /*nb_positive*/
+ proxy_abs, /*nb_absolute*/
+ (inquiry)proxy_nonzero, /*nb_nonzero*/
+ proxy_invert, /*nb_invert*/
+ proxy_lshift, /*nb_lshift*/
+ proxy_rshift, /*nb_rshift*/
+ proxy_and, /*nb_and*/
+ proxy_xor, /*nb_xor*/
+ proxy_or, /*nb_or*/
+ 0, /*nb_coerce*/
+ 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*/
+ proxy_idiv, /*nb_inplace_divide*/
+ proxy_imod, /*nb_inplace_remainder*/
+ proxy_ipow, /*nb_inplace_power*/
+ proxy_ilshift, /*nb_inplace_lshift*/
+ proxy_irshift, /*nb_inplace_rshift*/
+ proxy_iand, /*nb_inplace_and*/
+ proxy_ixor, /*nb_inplace_xor*/
+ proxy_ior, /*nb_inplace_or*/
};
static PySequenceMethods proxy_as_sequence = {
};
static PyMappingMethods proxy_as_mapping = {
- (lenfunc)proxy_length, /*mp_length*/
- (binaryfunc)proxy_getitem, /*mp_subscript*/
+ (lenfunc)proxy_length, /*mp_length*/
+ proxy_getitem, /*mp_subscript*/
(objobjargproc)proxy_setitem, /*mp_ass_subscript*/
};
0, /* tp_getattr */
0, /* tp_setattr */
proxy_compare, /* tp_compare */
- (unaryfunc)proxy_repr, /* tp_repr */
+ (reprfunc)proxy_repr, /* tp_repr */
&proxy_as_number, /* tp_as_number */
&proxy_as_sequence, /* tp_as_sequence */
&proxy_as_mapping, /* tp_as_mapping */
0, /* tp_hash */
- (ternaryfunc)0, /* tp_call */
- (unaryfunc)proxy_str, /* tp_str */
- (getattrofunc)proxy_getattr, /* tp_getattro */
+ 0, /* tp_call */
+ proxy_str, /* tp_str */
+ proxy_getattr, /* tp_getattro */
(setattrofunc)proxy_setattr, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC
&proxy_as_sequence, /* tp_as_sequence */
&proxy_as_mapping, /* tp_as_mapping */
0, /* tp_hash */
- (ternaryfunc)proxy_call, /* tp_call */
- (unaryfunc)proxy_str, /* tp_str */
- (getattrofunc)proxy_getattr, /* tp_getattro */
+ proxy_call, /* tp_call */
+ proxy_str, /* tp_str */
+ proxy_getattr, /* tp_getattro */
(setattrofunc)proxy_setattr, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC