diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index f2915f83b9d968..a8342a9a7becb4 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -2466,7 +2466,7 @@ tuplegetter_repr(_tuplegetterobject *self) static PyMemberDef tuplegetter_members[] = { - {"__doc__", _Py_T_OBJECT, offsetof(_tuplegetterobject, doc), 0}, + {"__doc__", Py_T_OBJECT_EX, offsetof(_tuplegetterobject, doc), 0}, {0} }; diff --git a/Modules/_csv.c b/Modules/_csv.c index 24a57e362521db..060eedcb75cc81 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -971,7 +971,7 @@ static struct PyMethodDef Reader_methods[] = { #define R_OFF(x) offsetof(ReaderObj, x) static struct PyMemberDef Reader_memberlist[] = { - { "dialect", _Py_T_OBJECT, R_OFF(dialect), Py_READONLY }, + { "dialect", Py_T_OBJECT_EX, R_OFF(dialect), Py_READONLY }, { "line_num", Py_T_ULONG, R_OFF(line_num), Py_READONLY }, { NULL } }; @@ -1365,7 +1365,7 @@ static struct PyMethodDef Writer_methods[] = { #define W_OFF(x) offsetof(WriterObj, x) static struct PyMemberDef Writer_memberlist[] = { - { "dialect", _Py_T_OBJECT, W_OFF(dialect), Py_READONLY }, + { "dialect", Py_T_OBJECT_EX, W_OFF(dialect), Py_READONLY }, { NULL } }; diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index c20d6ae55a06e7..3b7740eafd4ed2 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -2759,7 +2759,7 @@ PyCData_dealloc(PyObject *self) } static PyMemberDef PyCData_members[] = { - { "_b_base_", _Py_T_OBJECT, + { "_b_base_", Py_T_OBJECT_EX, offsetof(CDataObject, b_base), Py_READONLY, "the base object" }, { "_b_needsfree_", Py_T_INT, diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 69cf8a98af6636..4b9c107a40cf50 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -581,7 +581,7 @@ PyCArg_repr(PyCArgObject *self) } static PyMemberDef PyCArgType_members[] = { - { "_obj", _Py_T_OBJECT, + { "_obj", Py_T_OBJECT_EX, offsetof(PyCArgObject, obj), Py_READONLY, "the wrapped object" }, { NULL }, diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 389ff4391de0be..945a606c8eda10 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -340,11 +340,11 @@ PyDoc_STRVAR(partial_doc, #define OFF(x) offsetof(partialobject, x) static PyMemberDef partial_memberlist[] = { - {"func", _Py_T_OBJECT, OFF(fn), Py_READONLY, + {"func", Py_T_OBJECT_EX, OFF(fn), Py_READONLY, "function object to use in future partial calls"}, - {"args", _Py_T_OBJECT, OFF(args), Py_READONLY, + {"args", Py_T_OBJECT_EX, OFF(args), Py_READONLY, "tuple of arguments to future partial calls"}, - {"keywords", _Py_T_OBJECT, OFF(kw), Py_READONLY, + {"keywords", Py_T_OBJECT_EX, OFF(kw), Py_READONLY, "dictionary of keyword arguments to future partial calls"}, {"__weaklistoffset__", Py_T_PYSSIZET, offsetof(partialobject, weakreflist), Py_READONLY}, @@ -540,7 +540,7 @@ keyobject_traverse(keyobject *ko, visitproc visit, void *arg) } static PyMemberDef keyobject_members[] = { - {"obj", _Py_T_OBJECT, + {"obj", Py_T_OBJECT_EX, offsetof(keyobject, object), 0, PyDoc_STR("Value wrapped by a key function.")}, {NULL} diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index 0983a7bd151f40..bee262e8263511 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -2478,7 +2478,7 @@ static PyMethodDef bufferedreader_methods[] = { }; static PyMemberDef bufferedreader_members[] = { - {"raw", _Py_T_OBJECT, offsetof(buffered, raw), Py_READONLY}, + {"raw", Py_T_OBJECT_EX, offsetof(buffered, raw), Py_READONLY}, {"_finalizing", Py_T_BOOL, offsetof(buffered, finalizing), 0}, {"__weaklistoffset__", Py_T_PYSSIZET, offsetof(buffered, weakreflist), Py_READONLY}, {"__dictoffset__", Py_T_PYSSIZET, offsetof(buffered, dict), Py_READONLY}, @@ -2538,7 +2538,7 @@ static PyMethodDef bufferedwriter_methods[] = { }; static PyMemberDef bufferedwriter_members[] = { - {"raw", _Py_T_OBJECT, offsetof(buffered, raw), Py_READONLY}, + {"raw", Py_T_OBJECT_EX, offsetof(buffered, raw), Py_READONLY}, {"_finalizing", Py_T_BOOL, offsetof(buffered, finalizing), 0}, {"__weaklistoffset__", Py_T_PYSSIZET, offsetof(buffered, weakreflist), Py_READONLY}, {"__dictoffset__", Py_T_PYSSIZET, offsetof(buffered, dict), Py_READONLY}, @@ -2656,7 +2656,7 @@ static PyMethodDef bufferedrandom_methods[] = { }; static PyMemberDef bufferedrandom_members[] = { - {"raw", _Py_T_OBJECT, offsetof(buffered, raw), Py_READONLY}, + {"raw", Py_T_OBJECT_EX, offsetof(buffered, raw), Py_READONLY}, {"_finalizing", Py_T_BOOL, offsetof(buffered, finalizing), 0}, {"__weaklistoffset__", Py_T_PYSSIZET, offsetof(buffered, weakreflist), Py_READONLY}, {"__dictoffset__", Py_T_PYSSIZET, offsetof(buffered, dict), Py_READONLY}, diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 24d846e6634375..c987d4ad66d866 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -3230,8 +3230,8 @@ static PyMethodDef textiowrapper_methods[] = { }; static PyMemberDef textiowrapper_members[] = { - {"encoding", _Py_T_OBJECT, offsetof(textio, encoding), Py_READONLY}, - {"buffer", _Py_T_OBJECT, offsetof(textio, buffer), Py_READONLY}, + {"encoding", Py_T_OBJECT_EX, offsetof(textio, encoding), Py_READONLY}, + {"buffer", Py_T_OBJECT_EX, offsetof(textio, buffer), Py_READONLY}, {"line_buffering", Py_T_BOOL, offsetof(textio, line_buffering), Py_READONLY}, {"write_through", Py_T_BOOL, offsetof(textio, write_through), Py_READONLY}, {"_finalizing", Py_T_BOOL, offsetof(textio, finalizing), 0}, diff --git a/Modules/_json.c b/Modules/_json.c index 4fcaa07d9cfd81..13e1c3a7061a16 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -29,11 +29,11 @@ typedef struct _PyScannerObject { static PyMemberDef scanner_members[] = { {"strict", Py_T_BOOL, offsetof(PyScannerObject, strict), Py_READONLY, "strict"}, - {"object_hook", _Py_T_OBJECT, offsetof(PyScannerObject, object_hook), Py_READONLY, "object_hook"}, - {"object_pairs_hook", _Py_T_OBJECT, offsetof(PyScannerObject, object_pairs_hook), Py_READONLY}, - {"parse_float", _Py_T_OBJECT, offsetof(PyScannerObject, parse_float), Py_READONLY, "parse_float"}, - {"parse_int", _Py_T_OBJECT, offsetof(PyScannerObject, parse_int), Py_READONLY, "parse_int"}, - {"parse_constant", _Py_T_OBJECT, offsetof(PyScannerObject, parse_constant), Py_READONLY, "parse_constant"}, + {"object_hook", Py_T_OBJECT_EX, offsetof(PyScannerObject, object_hook), Py_READONLY, "object_hook"}, + {"object_pairs_hook", Py_T_OBJECT_EX, offsetof(PyScannerObject, object_pairs_hook), Py_READONLY}, + {"parse_float", Py_T_OBJECT_EX, offsetof(PyScannerObject, parse_float), Py_READONLY, "parse_float"}, + {"parse_int", Py_T_OBJECT_EX, offsetof(PyScannerObject, parse_int), Py_READONLY, "parse_int"}, + {"parse_constant", Py_T_OBJECT_EX, offsetof(PyScannerObject, parse_constant), Py_READONLY, "parse_constant"}, {NULL} }; @@ -52,12 +52,12 @@ typedef struct _PyEncoderObject { } PyEncoderObject; static PyMemberDef encoder_members[] = { - {"markers", _Py_T_OBJECT, offsetof(PyEncoderObject, markers), Py_READONLY, "markers"}, - {"default", _Py_T_OBJECT, offsetof(PyEncoderObject, defaultfn), Py_READONLY, "default"}, - {"encoder", _Py_T_OBJECT, offsetof(PyEncoderObject, encoder), Py_READONLY, "encoder"}, - {"indent", _Py_T_OBJECT, offsetof(PyEncoderObject, indent), Py_READONLY, "indent"}, - {"key_separator", _Py_T_OBJECT, offsetof(PyEncoderObject, key_separator), Py_READONLY, "key_separator"}, - {"item_separator", _Py_T_OBJECT, offsetof(PyEncoderObject, item_separator), Py_READONLY, "item_separator"}, + {"markers", Py_T_OBJECT_EX, offsetof(PyEncoderObject, markers), Py_READONLY, "markers"}, + {"default", Py_T_OBJECT_EX, offsetof(PyEncoderObject, defaultfn), Py_READONLY, "default"}, + {"encoder", Py_T_OBJECT_EX, offsetof(PyEncoderObject, encoder), Py_READONLY, "encoder"}, + {"indent", Py_T_OBJECT_EX, offsetof(PyEncoderObject, indent), Py_READONLY, "indent"}, + {"key_separator", Py_T_OBJECT_EX, offsetof(PyEncoderObject, key_separator), Py_READONLY, "key_separator"}, + {"item_separator", Py_T_OBJECT_EX, offsetof(PyEncoderObject, item_separator), Py_READONLY, "item_separator"}, {"sort_keys", Py_T_BOOL, offsetof(PyEncoderObject, sort_keys), Py_READONLY, "sort_keys"}, {"skipkeys", Py_T_BOOL, offsetof(PyEncoderObject, skipkeys), Py_READONLY, "skipkeys"}, {NULL} diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index ddd7ace81198bb..36bede0fb72914 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -2511,18 +2511,18 @@ static PyMethodDef connection_methods[] = { static struct PyMemberDef connection_members[] = { - {"Warning", _Py_T_OBJECT, offsetof(pysqlite_Connection, Warning), Py_READONLY}, - {"Error", _Py_T_OBJECT, offsetof(pysqlite_Connection, Error), Py_READONLY}, - {"InterfaceError", _Py_T_OBJECT, offsetof(pysqlite_Connection, InterfaceError), Py_READONLY}, - {"DatabaseError", _Py_T_OBJECT, offsetof(pysqlite_Connection, DatabaseError), Py_READONLY}, - {"DataError", _Py_T_OBJECT, offsetof(pysqlite_Connection, DataError), Py_READONLY}, - {"OperationalError", _Py_T_OBJECT, offsetof(pysqlite_Connection, OperationalError), Py_READONLY}, - {"IntegrityError", _Py_T_OBJECT, offsetof(pysqlite_Connection, IntegrityError), Py_READONLY}, - {"InternalError", _Py_T_OBJECT, offsetof(pysqlite_Connection, InternalError), Py_READONLY}, - {"ProgrammingError", _Py_T_OBJECT, offsetof(pysqlite_Connection, ProgrammingError), Py_READONLY}, - {"NotSupportedError", _Py_T_OBJECT, offsetof(pysqlite_Connection, NotSupportedError), Py_READONLY}, - {"row_factory", _Py_T_OBJECT, offsetof(pysqlite_Connection, row_factory)}, - {"text_factory", _Py_T_OBJECT, offsetof(pysqlite_Connection, text_factory)}, + {"Warning", Py_T_OBJECT_EX, offsetof(pysqlite_Connection, Warning), Py_READONLY}, + {"Error", Py_T_OBJECT_EX, offsetof(pysqlite_Connection, Error), Py_READONLY}, + {"InterfaceError", Py_T_OBJECT_EX, offsetof(pysqlite_Connection, InterfaceError), Py_READONLY}, + {"DatabaseError", Py_T_OBJECT_EX, offsetof(pysqlite_Connection, DatabaseError), Py_READONLY}, + {"DataError", Py_T_OBJECT_EX, offsetof(pysqlite_Connection, DataError), Py_READONLY}, + {"OperationalError", Py_T_OBJECT_EX, offsetof(pysqlite_Connection, OperationalError), Py_READONLY}, + {"IntegrityError", Py_T_OBJECT_EX, offsetof(pysqlite_Connection, IntegrityError), Py_READONLY}, + {"InternalError", Py_T_OBJECT_EX, offsetof(pysqlite_Connection, InternalError), Py_READONLY}, + {"ProgrammingError", Py_T_OBJECT_EX, offsetof(pysqlite_Connection, ProgrammingError), Py_READONLY}, + {"NotSupportedError", Py_T_OBJECT_EX, offsetof(pysqlite_Connection, NotSupportedError), Py_READONLY}, + {"row_factory", Py_T_OBJECT_EX, offsetof(pysqlite_Connection, row_factory)}, + {"text_factory", Py_T_OBJECT_EX, offsetof(pysqlite_Connection, text_factory)}, {NULL} }; diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index 618ce532b2518d..f3ec0f8465d287 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -1325,12 +1325,12 @@ static PyMethodDef cursor_methods[] = { static struct PyMemberDef cursor_members[] = { - {"connection", _Py_T_OBJECT, offsetof(pysqlite_Cursor, connection), Py_READONLY}, - {"description", _Py_T_OBJECT, offsetof(pysqlite_Cursor, description), Py_READONLY}, + {"connection", Py_T_OBJECT_EX, offsetof(pysqlite_Cursor, connection), Py_READONLY}, + {"description", Py_T_OBJECT_EX, offsetof(pysqlite_Cursor, description), Py_READONLY}, {"arraysize", Py_T_INT, offsetof(pysqlite_Cursor, arraysize), 0}, - {"lastrowid", _Py_T_OBJECT, offsetof(pysqlite_Cursor, lastrowid), Py_READONLY}, + {"lastrowid", Py_T_OBJECT_EX, offsetof(pysqlite_Cursor, lastrowid), Py_READONLY}, {"rowcount", Py_T_LONG, offsetof(pysqlite_Cursor, rowcount), Py_READONLY}, - {"row_factory", _Py_T_OBJECT, offsetof(pysqlite_Cursor, row_factory), 0}, + {"row_factory", Py_T_OBJECT_EX, offsetof(pysqlite_Cursor, row_factory), 0}, {"__weaklistoffset__", Py_T_PYSSIZET, offsetof(pysqlite_Cursor, in_weakreflist), Py_READONLY}, {NULL} }; diff --git a/Modules/_sre/sre.c b/Modules/_sre/sre.c index c4e43a0db0f5d3..0ef88bc5f33f9f 100644 --- a/Modules/_sre/sre.c +++ b/Modules/_sre/sre.c @@ -2994,7 +2994,7 @@ static PyGetSetDef pattern_getset[] = { #define PAT_OFF(x) offsetof(PatternObject, x) static PyMemberDef pattern_members[] = { - {"pattern", _Py_T_OBJECT, PAT_OFF(pattern), Py_READONLY, + {"pattern", Py_T_OBJECT_EX, PAT_OFF(pattern), Py_READONLY, "The pattern string from which the RE object was compiled."}, {"flags", Py_T_INT, PAT_OFF(flags), Py_READONLY, "The regex matching flags."}, @@ -3053,9 +3053,9 @@ static PyGetSetDef match_getset[] = { #define MATCH_OFF(x) offsetof(MatchObject, x) static PyMemberDef match_members[] = { - {"string", _Py_T_OBJECT, MATCH_OFF(string), Py_READONLY, + {"string", Py_T_OBJECT_EX, MATCH_OFF(string), Py_READONLY, "The string passed to match() or search()."}, - {"re", _Py_T_OBJECT, MATCH_OFF(pattern), Py_READONLY, + {"re", Py_T_OBJECT_EX, MATCH_OFF(pattern), Py_READONLY, "The regular expression object."}, {"pos", Py_T_PYSSIZET, MATCH_OFF(pos), Py_READONLY, "The index into the string at which the RE engine started looking for a match."}, @@ -3103,7 +3103,7 @@ static PyMethodDef scanner_methods[] = { #define SCAN_OFF(x) offsetof(ScannerObject, x) static PyMemberDef scanner_members[] = { - {"pattern", _Py_T_OBJECT, SCAN_OFF(pattern), Py_READONLY}, + {"pattern", Py_T_OBJECT_EX, SCAN_OFF(pattern), Py_READONLY}, {NULL} /* Sentinel */ }; diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index 5d3c16a98423ba..128644a8c9ad62 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -1613,7 +1613,7 @@ static struct PyMethodDef mbstreamreader_methods[] = { }; static PyMemberDef mbstreamreader_members[] = { - {"stream", _Py_T_OBJECT, + {"stream", Py_T_OBJECT_EX, offsetof(MultibyteStreamReaderObject, stream), Py_READONLY, NULL}, {NULL,} @@ -1921,7 +1921,7 @@ static struct PyMethodDef mbstreamwriter_methods[] = { }; static PyMemberDef mbstreamwriter_members[] = { - {"stream", _Py_T_OBJECT, + {"stream", Py_T_OBJECT_EX, offsetof(MultibyteStreamWriterObject, stream), Py_READONLY, NULL}, {NULL,} diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index a8ce84c0bb9f05..b9b1ae839ed492 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -1470,7 +1470,7 @@ xmlparse_specified_attributes_setter(xmlparseobject *self, PyObject *v, void *cl } static PyMemberDef xmlparse_members[] = { - {"intern", _Py_T_OBJECT, offsetof(xmlparseobject, intern), Py_READONLY, NULL}, + {"intern", Py_T_OBJECT_EX, offsetof(xmlparseobject, intern), Py_READONLY, NULL}, {NULL} }; diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index 22da50989a88dc..93b8dfda2285ec 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -1801,8 +1801,8 @@ static PyMethodDef ZlibDecompressor_methods[] = { #define COMP_OFF(x) offsetof(compobject, x) static PyMemberDef Decomp_members[] = { - {"unused_data", _Py_T_OBJECT, COMP_OFF(unused_data), Py_READONLY}, - {"unconsumed_tail", _Py_T_OBJECT, COMP_OFF(unconsumed_tail), Py_READONLY}, + {"unused_data", Py_T_OBJECT_EX, COMP_OFF(unused_data), Py_READONLY}, + {"unconsumed_tail", Py_T_OBJECT_EX, COMP_OFF(unconsumed_tail), Py_READONLY}, {"eof", Py_T_BOOL, COMP_OFF(eof), Py_READONLY}, {NULL}, }; diff --git a/Objects/classobject.c b/Objects/classobject.c index 6f4457d42dda99..464b6f5f56e805 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -150,9 +150,9 @@ static PyMethodDef method_methods[] = { #define MO_OFF(x) offsetof(PyMethodObject, x) static PyMemberDef method_memberlist[] = { - {"__func__", _Py_T_OBJECT, MO_OFF(im_func), Py_READONLY, + {"__func__", Py_T_OBJECT_EX, MO_OFF(im_func), Py_READONLY, "the function (or other callable) implementing a method"}, - {"__self__", _Py_T_OBJECT, MO_OFF(im_self), Py_READONLY, + {"__self__", Py_T_OBJECT_EX, MO_OFF(im_self), Py_READONLY, "the instance to which a method is bound"}, {NULL} /* Sentinel */ }; @@ -372,7 +372,7 @@ PyInstanceMethod_Function(PyObject *im) #define IMO_OFF(x) offsetof(PyInstanceMethodObject, x) static PyMemberDef instancemethod_memberlist[] = { - {"__func__", _Py_T_OBJECT, IMO_OFF(func), Py_READONLY, + {"__func__", Py_T_OBJECT_EX, IMO_OFF(func), Py_READONLY, "the function (or other callable) implementing a method"}, {NULL} /* Sentinel */ }; diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 81fa33962e0101..69718372b8e98b 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -1883,14 +1883,14 @@ static PyMemberDef code_memberlist[] = { {"co_stacksize", Py_T_INT, OFF(co_stacksize), Py_READONLY}, {"co_flags", Py_T_INT, OFF(co_flags), Py_READONLY}, {"co_nlocals", Py_T_INT, OFF(co_nlocals), Py_READONLY}, - {"co_consts", _Py_T_OBJECT, OFF(co_consts), Py_READONLY}, - {"co_names", _Py_T_OBJECT, OFF(co_names), Py_READONLY}, - {"co_filename", _Py_T_OBJECT, OFF(co_filename), Py_READONLY}, - {"co_name", _Py_T_OBJECT, OFF(co_name), Py_READONLY}, - {"co_qualname", _Py_T_OBJECT, OFF(co_qualname), Py_READONLY}, + {"co_consts", Py_T_OBJECT_EX, OFF(co_consts), Py_READONLY}, + {"co_names", Py_T_OBJECT_EX, OFF(co_names), Py_READONLY}, + {"co_filename", Py_T_OBJECT_EX, OFF(co_filename), Py_READONLY}, + {"co_name", Py_T_OBJECT_EX, OFF(co_name), Py_READONLY}, + {"co_qualname", Py_T_OBJECT_EX, OFF(co_qualname), Py_READONLY}, {"co_firstlineno", Py_T_INT, OFF(co_firstlineno), Py_READONLY}, - {"co_linetable", _Py_T_OBJECT, OFF(co_linetable), Py_READONLY}, - {"co_exceptiontable", _Py_T_OBJECT, OFF(co_exceptiontable), Py_READONLY}, + {"co_linetable", Py_T_OBJECT_EX, OFF(co_linetable), Py_READONLY}, + {"co_exceptiontable", Py_T_OBJECT_EX, OFF(co_exceptiontable), Py_READONLY}, {NULL} /* Sentinel */ }; diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 60383dd06d1add..e9fb8e7262c67f 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -640,8 +640,8 @@ static PyMethodDef descr_methods[] = { }; static PyMemberDef descr_members[] = { - {"__objclass__", _Py_T_OBJECT, offsetof(PyDescrObject, d_type), Py_READONLY}, - {"__name__", _Py_T_OBJECT, offsetof(PyDescrObject, d_name), Py_READONLY}, + {"__objclass__", Py_T_OBJECT_EX, offsetof(PyDescrObject, d_type), Py_READONLY}, + {"__name__", Py_T_OBJECT_EX, offsetof(PyDescrObject, d_name), Py_READONLY}, {0} }; @@ -1355,7 +1355,7 @@ static PyMethodDef wrapper_methods[] = { }; static PyMemberDef wrapper_members[] = { - {"__self__", _Py_T_OBJECT, offsetof(wrapperobject, self), Py_READONLY}, + {"__self__", Py_T_OBJECT_EX, offsetof(wrapperobject, self), Py_READONLY}, {0} }; @@ -1515,7 +1515,7 @@ static PyObject * property_copy(PyObject *, PyObject *, PyObject *, PyObject *); static PyMemberDef property_members[] = { - {"fget", _Py_T_OBJECT, offsetof(propertyobject, prop_get), Py_READONLY}, + {"fget", Py_T_OBJECT_EX, offsetof(propertyobject, prop_get), Py_READONLY}, {"fset", _Py_T_OBJECT, offsetof(propertyobject, prop_set), Py_READONLY}, {"fdel", _Py_T_OBJECT, offsetof(propertyobject, prop_del), Py_READONLY}, {"__doc__", _Py_T_OBJECT, offsetof(propertyobject, prop_doc), 0}, diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 62a44234b34047..245242ee62dc82 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -569,7 +569,7 @@ SimpleExtendsException(PyExc_Exception, StopAsyncIteration, */ static PyMemberDef StopIteration_members[] = { - {"value", _Py_T_OBJECT, offsetof(PyStopIterationObject, value), 0, + {"value", Py_T_OBJECT_EX, offsetof(PyStopIterationObject, value), 0, PyDoc_STR("generator return value")}, {NULL} /* Sentinel */ }; @@ -1477,9 +1477,9 @@ PyUnstable_Exc_PrepReraiseStar(PyObject *orig, PyObject *excs) } static PyMemberDef BaseExceptionGroup_members[] = { - {"message", _Py_T_OBJECT, offsetof(PyBaseExceptionGroupObject, msg), Py_READONLY, + {"message", Py_T_OBJECT_EX, offsetof(PyBaseExceptionGroupObject, msg), Py_READONLY, PyDoc_STR("exception message")}, - {"exceptions", _Py_T_OBJECT, offsetof(PyBaseExceptionGroupObject, excs), Py_READONLY, + {"exceptions", Py_T_OBJECT_EX, offsetof(PyBaseExceptionGroupObject, excs), Py_READONLY, PyDoc_STR("nested exceptions")}, {NULL} /* Sentinel */ }; @@ -1660,7 +1660,7 @@ static PyMemberDef ImportError_members[] = { PyDoc_STR("module name")}, {"path", _Py_T_OBJECT, offsetof(PyImportErrorObject, path), 0, PyDoc_STR("module path")}, - {"name_from", _Py_T_OBJECT, offsetof(PyImportErrorObject, name_from), 0, + {"name_from", Py_T_OBJECT_EX, offsetof(PyImportErrorObject, name_from), 0, PyDoc_STR("name imported from module")}, {NULL} /* Sentinel */ }; @@ -2249,7 +2249,7 @@ NameError_traverse(PyNameErrorObject *self, visitproc visit, void *arg) } static PyMemberDef NameError_members[] = { - {"name", _Py_T_OBJECT, offsetof(PyNameErrorObject, name), 0, PyDoc_STR("name")}, + {"name", Py_T_OBJECT_EX, offsetof(PyNameErrorObject, name), 0, PyDoc_STR("name")}, {NULL} /* Sentinel */ }; @@ -2910,15 +2910,15 @@ UnicodeError_traverse(PyUnicodeErrorObject *self, visitproc visit, void *arg) } static PyMemberDef UnicodeError_members[] = { - {"encoding", _Py_T_OBJECT, offsetof(PyUnicodeErrorObject, encoding), 0, + {"encoding", Py_T_OBJECT_EX, offsetof(PyUnicodeErrorObject, encoding), 0, PyDoc_STR("exception encoding")}, - {"object", _Py_T_OBJECT, offsetof(PyUnicodeErrorObject, object), 0, + {"object", Py_T_OBJECT_EX, offsetof(PyUnicodeErrorObject, object), 0, PyDoc_STR("exception object")}, {"start", Py_T_PYSSIZET, offsetof(PyUnicodeErrorObject, start), 0, PyDoc_STR("exception start")}, {"end", Py_T_PYSSIZET, offsetof(PyUnicodeErrorObject, end), 0, PyDoc_STR("exception end")}, - {"reason", _Py_T_OBJECT, offsetof(PyUnicodeErrorObject, reason), 0, + {"reason", Py_T_OBJECT_EX, offsetof(PyUnicodeErrorObject, reason), 0, PyDoc_STR("exception reason")}, {NULL} /* Sentinel */ }; diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 7fffa1c8bbff96..48e4914a7cbc5e 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -453,9 +453,9 @@ PyFunction_SetAnnotations(PyObject *op, PyObject *annotations) static PyMemberDef func_memberlist[] = { {"__closure__", _Py_T_OBJECT, OFF(func_closure), Py_READONLY}, {"__doc__", _Py_T_OBJECT, OFF(func_doc), 0}, - {"__globals__", _Py_T_OBJECT, OFF(func_globals), Py_READONLY}, + {"__globals__", Py_T_OBJECT_EX, OFF(func_globals), Py_READONLY}, {"__module__", _Py_T_OBJECT, OFF(func_module), 0}, - {"__builtins__", _Py_T_OBJECT, OFF(func_builtins), Py_READONLY}, + {"__builtins__", Py_T_OBJECT_EX, OFF(func_builtins), Py_READONLY}, {NULL} /* Sentinel */ }; @@ -1063,8 +1063,8 @@ cm_init(PyObject *self, PyObject *args, PyObject *kwds) } static PyMemberDef cm_memberlist[] = { - {"__func__", _Py_T_OBJECT, offsetof(classmethod, cm_callable), Py_READONLY}, - {"__wrapped__", _Py_T_OBJECT, offsetof(classmethod, cm_callable), Py_READONLY}, + {"__func__", Py_T_OBJECT_EX, offsetof(classmethod, cm_callable), Py_READONLY}, + {"__wrapped__", Py_T_OBJECT_EX, offsetof(classmethod, cm_callable), Py_READONLY}, {NULL} /* Sentinel */ }; @@ -1258,8 +1258,8 @@ sm_call(PyObject *callable, PyObject *args, PyObject *kwargs) } static PyMemberDef sm_memberlist[] = { - {"__func__", _Py_T_OBJECT, offsetof(staticmethod, sm_callable), Py_READONLY}, - {"__wrapped__", _Py_T_OBJECT, offsetof(staticmethod, sm_callable), Py_READONLY}, + {"__func__", Py_T_OBJECT_EX, offsetof(staticmethod, sm_callable), Py_READONLY}, + {"__wrapped__", Py_T_OBJECT_EX, offsetof(staticmethod, sm_callable), Py_READONLY}, {NULL} /* Sentinel */ }; diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index df8873454aeb36..9628162eb84d5b 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -782,8 +782,8 @@ static PyMethodDef ga_methods[] = { }; static PyMemberDef ga_members[] = { - {"__origin__", _Py_T_OBJECT, offsetof(gaobject, origin), Py_READONLY}, - {"__args__", _Py_T_OBJECT, offsetof(gaobject, args), Py_READONLY}, + {"__origin__", Py_T_OBJECT_EX, offsetof(gaobject, origin), Py_READONLY}, + {"__args__", Py_T_OBJECT_EX, offsetof(gaobject, args), Py_READONLY}, {"__unpacked__", Py_T_BOOL, offsetof(gaobject, starred), Py_READONLY}, {0} }; diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 7e890d021cb946..7505b7a5546c9b 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -13,7 +13,7 @@ static PyMemberDef module_members[] = { - {"__dict__", _Py_T_OBJECT, offsetof(PyModuleObject, md_dict), Py_READONLY}, + {"__dict__", Py_T_OBJECT_EX, offsetof(PyModuleObject, md_dict), Py_READONLY}, {0} }; diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c index 11cf859add3ab8..58022334247696 100644 --- a/Objects/namespaceobject.c +++ b/Objects/namespaceobject.c @@ -14,7 +14,7 @@ typedef struct { static PyMemberDef namespace_members[] = { - {"__dict__", _Py_T_OBJECT, offsetof(_PyNamespaceObject, ns_dict), Py_READONLY}, + {"__dict__", Py_T_OBJECT_EX, offsetof(_PyNamespaceObject, ns_dict), Py_READONLY}, {NULL} }; diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index dc3aad11ce10e5..935f67b3bec656 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c @@ -377,9 +377,9 @@ slice_repr(PySliceObject *r) } static PyMemberDef slice_members[] = { - {"start", _Py_T_OBJECT, offsetof(PySliceObject, start), Py_READONLY}, - {"stop", _Py_T_OBJECT, offsetof(PySliceObject, stop), Py_READONLY}, - {"step", _Py_T_OBJECT, offsetof(PySliceObject, step), Py_READONLY}, + {"start", Py_T_OBJECT_EX, offsetof(PySliceObject, start), Py_READONLY}, + {"stop", Py_T_OBJECT_EX, offsetof(PySliceObject, stop), Py_READONLY}, + {"step", Py_T_OBJECT_EX, offsetof(PySliceObject, step), Py_READONLY}, {0} }; diff --git a/Objects/structseq.c b/Objects/structseq.c index 700f67c09c9e57..2f3722daca77f0 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -465,7 +465,7 @@ initialize_members(PyStructSequence_Desc *desc, /* The names and docstrings in these MemberDefs are statically */ /* allocated so it is expected that they'll outlive the MemberDef */ members[k].name = desc->fields[i].name; - members[k].type = _Py_T_OBJECT; + members[k].type = Py_T_OBJECT_EX; members[k].offset = offsetof(PyStructSequence, ob_item) + i * sizeof(PyObject*); members[k].flags = Py_READONLY; diff --git a/Objects/typeobject.c b/Objects/typeobject.c index abe33f1562059d..5dfd9a443b98d3 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -942,7 +942,7 @@ static PyMemberDef type_members[] = { since the memory at this offset will always be NULL. */ {"__weakrefoffset__", Py_T_PYSSIZET, offsetof(PyTypeObject, tp_weaklistoffset), Py_READONLY}, - {"__base__", _Py_T_OBJECT, offsetof(PyTypeObject, tp_base), Py_READONLY}, + {"__base__", Py_T_OBJECT_EX, offsetof(PyTypeObject, tp_base), Py_READONLY}, {"__dictoffset__", Py_T_PYSSIZET, offsetof(PyTypeObject, tp_dictoffset), Py_READONLY}, {0} @@ -10178,11 +10178,11 @@ typedef struct { } superobject; static PyMemberDef super_members[] = { - {"__thisclass__", _Py_T_OBJECT, offsetof(superobject, type), Py_READONLY, + {"__thisclass__", Py_T_OBJECT_EX, offsetof(superobject, type), Py_READONLY, "the class invoking super()"}, - {"__self__", _Py_T_OBJECT, offsetof(superobject, obj), Py_READONLY, + {"__self__", Py_T_OBJECT_EX, offsetof(superobject, obj), Py_READONLY, "the instance invoking super(); may be None"}, - {"__self_class__", _Py_T_OBJECT, offsetof(superobject, obj_type), Py_READONLY, + {"__self_class__", Py_T_OBJECT_EX, offsetof(superobject, obj_type), Py_READONLY, "the type of the instance invoking super(); may be None"}, {0} }; diff --git a/Objects/typevarobject.c b/Objects/typevarobject.c index e09e6a62553cff..8d110ea99311ea 100644 --- a/Objects/typevarobject.c +++ b/Objects/typevarobject.c @@ -244,7 +244,7 @@ typevar_repr(PyObject *self) } static PyMemberDef typevar_members[] = { - {"__name__", _Py_T_OBJECT, offsetof(typevarobject, name), Py_READONLY}, + {"__name__", Py_T_OBJECT_EX, offsetof(typevarobject, name), Py_READONLY}, {"__covariant__", Py_T_BOOL, offsetof(typevarobject, covariant), Py_READONLY}, {"__contravariant__", Py_T_BOOL, offsetof(typevarobject, contravariant), Py_READONLY}, {"__infer_variance__", Py_T_BOOL, offsetof(typevarobject, infer_variance), Py_READONLY}, @@ -555,7 +555,7 @@ paramspecattr_richcompare(PyObject *a, PyObject *b, int op) } static PyMemberDef paramspecattr_members[] = { - {"__origin__", _Py_T_OBJECT, offsetof(paramspecattrobject, __origin__), Py_READONLY}, + {"__origin__", Py_T_OBJECT_EX, offsetof(paramspecattrobject, __origin__), Py_READONLY}, {0} }; @@ -780,8 +780,8 @@ paramspec_repr(PyObject *self) } static PyMemberDef paramspec_members[] = { - {"__name__", _Py_T_OBJECT, offsetof(paramspecobject, name), Py_READONLY}, - {"__bound__", _Py_T_OBJECT, offsetof(paramspecobject, bound), Py_READONLY}, + {"__name__", Py_T_OBJECT_EX, offsetof(paramspecobject, name), Py_READONLY}, + {"__bound__", Py_T_OBJECT_EX, offsetof(paramspecobject, bound), Py_READONLY}, {"__covariant__", Py_T_BOOL, offsetof(paramspecobject, covariant), Py_READONLY}, {"__contravariant__", Py_T_BOOL, offsetof(paramspecobject, contravariant), Py_READONLY}, {"__infer_variance__", Py_T_BOOL, offsetof(paramspecobject, infer_variance), Py_READONLY}, @@ -1054,7 +1054,7 @@ typevartuple_repr(PyObject *self) } static PyMemberDef typevartuple_members[] = { - {"__name__", _Py_T_OBJECT, offsetof(typevartupleobject, name), Py_READONLY}, + {"__name__", Py_T_OBJECT_EX, offsetof(typevartupleobject, name), Py_READONLY}, {0} }; @@ -1292,7 +1292,7 @@ typealias_repr(PyObject *self) } static PyMemberDef typealias_members[] = { - {"__name__", _Py_T_OBJECT, offsetof(typealiasobject, name), Py_READONLY}, + {"__name__", Py_T_OBJECT_EX, offsetof(typealiasobject, name), Py_READONLY}, {0} }; diff --git a/Objects/unionobject.c b/Objects/unionobject.c index 347945a4c45972..6e20110b30beae 100644 --- a/Objects/unionobject.c +++ b/Objects/unionobject.c @@ -273,7 +273,7 @@ union_repr(PyObject *self) } static PyMemberDef union_members[] = { - {"__args__", _Py_T_OBJECT, offsetof(unionobject, args), Py_READONLY}, + {"__args__", Py_T_OBJECT_EX, offsetof(unionobject, args), Py_READONLY}, {0} }; diff --git a/Python/context.c b/Python/context.c index 9ac51874fb5be5..62694f6c3f57d1 100644 --- a/Python/context.c +++ b/Python/context.c @@ -1042,7 +1042,7 @@ _contextvars_ContextVar_reset(PyContextVar *self, PyObject *token) static PyMemberDef PyContextVar_members[] = { - {"name", _Py_T_OBJECT, offsetof(PyContextVar, var_name), Py_READONLY}, + {"name", Py_T_OBJECT_EX, offsetof(PyContextVar, var_name), Py_READONLY}, {NULL} }; diff --git a/Python/symtable.c b/Python/symtable.c index 04be3192d6c7c4..553a54077b79ac 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -171,11 +171,11 @@ ste_dealloc(PySTEntryObject *ste) #define OFF(x) offsetof(PySTEntryObject, x) static PyMemberDef ste_memberlist[] = { - {"id", _Py_T_OBJECT, OFF(ste_id), Py_READONLY}, - {"name", _Py_T_OBJECT, OFF(ste_name), Py_READONLY}, - {"symbols", _Py_T_OBJECT, OFF(ste_symbols), Py_READONLY}, - {"varnames", _Py_T_OBJECT, OFF(ste_varnames), Py_READONLY}, - {"children", _Py_T_OBJECT, OFF(ste_children), Py_READONLY}, + {"id", Py_T_OBJECT_EX, OFF(ste_id), Py_READONLY}, + {"name", Py_T_OBJECT_EX, OFF(ste_name), Py_READONLY}, + {"symbols", Py_T_OBJECT_EX, OFF(ste_symbols), Py_READONLY}, + {"varnames", Py_T_OBJECT_EX, OFF(ste_varnames), Py_READONLY}, + {"children", Py_T_OBJECT_EX, OFF(ste_children), Py_READONLY}, {"nested", Py_T_INT, OFF(ste_nested), Py_READONLY}, {"type", Py_T_INT, OFF(ste_type), Py_READONLY}, {"lineno", Py_T_INT, OFF(ste_lineno), Py_READONLY}, diff --git a/Python/traceback.c b/Python/traceback.c index ca524b1b9af78b..2ccdaf7c34a9be 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -148,7 +148,7 @@ static PyMethodDef tb_methods[] = { }; static PyMemberDef tb_memberlist[] = { - {"tb_frame", _Py_T_OBJECT, OFF(tb_frame), Py_READONLY|Py_AUDIT_READ}, + {"tb_frame", Py_T_OBJECT_EX, OFF(tb_frame), Py_READONLY|Py_AUDIT_READ}, {"tb_lasti", Py_T_INT, OFF(tb_lasti), Py_READONLY}, {"tb_lineno", Py_T_INT, OFF(tb_lineno), Py_READONLY}, {NULL} /* Sentinel */