File tree Expand file tree Collapse file tree 12 files changed +29
-2
lines changed Expand file tree Collapse file tree 12 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ extern PyTypeObject _PyExc_MemoryError;
8585 .double_format = _py_float_format_unknown, \
8686 }, \
8787 .types = { \
88- .next_version_tag = 1 , \
88+ .next_version_tag = _Py_TYPE_VERSION_NEXT , \
8989 }, \
9090 .static_objects = { \
9191 .singletons = { \
Original file line number Diff line number Diff line change @@ -14,6 +14,21 @@ extern "C" {
1414
1515/* state */
1616
17+ #define _Py_TYPE_VERSION_INT 1
18+ #define _Py_TYPE_VERSION_FLOAT 2
19+ #define _Py_TYPE_VERSION_LIST 3
20+ #define _Py_TYPE_VERSION_TUPLE 4
21+ #define _Py_TYPE_VERSION_STR 5
22+ #define _Py_TYPE_VERSION_SET 6
23+ #define _Py_TYPE_VERSION_FROZEN_SET 7
24+ #define _Py_TYPE_VERSION_DICT 8
25+ #define _Py_TYPE_VERSION_BYTEARRAY 9
26+ #define _Py_TYPE_VERSION_BYTES 10
27+ #define _Py_TYPE_VERSION_COMPLEX 11
28+
29+ #define _Py_TYPE_VERSION_NEXT 16
30+
31+
1732#define _Py_TYPE_BASE_VERSION_TAG (2<<16)
1833#define _Py_MAX_GLOBAL_TYPE_VERSION_TAG (_Py_TYPE_BASE_VERSION_TAG - 1)
1934
Original file line number Diff line number Diff line change @@ -2452,6 +2452,7 @@ PyTypeObject PyByteArray_Type = {
24522452 PyType_GenericAlloc , /* tp_alloc */
24532453 PyType_GenericNew , /* tp_new */
24542454 PyObject_Free , /* tp_free */
2455+ .tp_version_tag = _Py_TYPE_VERSION_BYTEARRAY ,
24552456};
24562457
24572458/*********************** Bytearray Iterator ****************************/
Original file line number Diff line number Diff line change @@ -3080,6 +3080,7 @@ PyTypeObject PyBytes_Type = {
30803080 bytes_alloc , /* tp_alloc */
30813081 bytes_new , /* tp_new */
30823082 PyObject_Free , /* tp_free */
3083+ .tp_version_tag = _Py_TYPE_VERSION_BYTES ,
30833084};
30843085
30853086void
Original file line number Diff line number Diff line change @@ -1250,4 +1250,5 @@ PyTypeObject PyComplex_Type = {
12501250 PyType_GenericAlloc , /* tp_alloc */
12511251 actual_complex_new , /* tp_new */
12521252 PyObject_Free , /* tp_free */
1253+ .tp_version_tag = _Py_TYPE_VERSION_COMPLEX ,
12531254};
Original file line number Diff line number Diff line change @@ -4912,6 +4912,7 @@ PyTypeObject PyDict_Type = {
49124912 dict_new , /* tp_new */
49134913 PyObject_GC_Del , /* tp_free */
49144914 .tp_vectorcall = dict_vectorcall ,
4915+ .tp_version_tag = _Py_TYPE_VERSION_DICT ,
49154916};
49164917
49174918/* For backward compatibility with old dictionary interface */
Original file line number Diff line number Diff line change @@ -1916,6 +1916,7 @@ PyTypeObject PyFloat_Type = {
19161916 0 , /* tp_alloc */
19171917 float_new , /* tp_new */
19181918 .tp_vectorcall = (vectorcallfunc )float_vectorcall ,
1919+ .tp_version_tag = _Py_TYPE_VERSION_FLOAT ,
19191920};
19201921
19211922static void
Original file line number Diff line number Diff line change @@ -3774,6 +3774,7 @@ PyTypeObject PyList_Type = {
37743774 PyType_GenericNew , /* tp_new */
37753775 PyObject_GC_Del , /* tp_free */
37763776 .tp_vectorcall = list_vectorcall ,
3777+ .tp_version_tag = _Py_TYPE_VERSION_LIST ,
37773778};
37783779
37793780/*********************** List Iterator **************************/
Original file line number Diff line number Diff line change @@ -6584,6 +6584,7 @@ PyTypeObject PyLong_Type = {
65846584 long_new , /* tp_new */
65856585 PyObject_Free , /* tp_free */
65866586 .tp_vectorcall = long_vectorcall ,
6587+ .tp_version_tag = _Py_TYPE_VERSION_INT ,
65876588};
65886589
65896590static PyTypeObject Int_InfoType ;
Original file line number Diff line number Diff line change @@ -2518,6 +2518,7 @@ PyTypeObject PySet_Type = {
25182518 set_new , /* tp_new */
25192519 PyObject_GC_Del , /* tp_free */
25202520 .tp_vectorcall = set_vectorcall ,
2521+ .tp_version_tag = _Py_TYPE_VERSION_SET ,
25212522};
25222523
25232524/* frozenset object ********************************************************/
@@ -2608,6 +2609,7 @@ PyTypeObject PyFrozenSet_Type = {
26082609 frozenset_new , /* tp_new */
26092610 PyObject_GC_Del , /* tp_free */
26102611 .tp_vectorcall = frozenset_vectorcall ,
2612+ .tp_version_tag = _Py_TYPE_VERSION_FROZEN_SET ,
26112613};
26122614
26132615
You can’t perform that action at this time.
0 commit comments