Skip to content

Commit 0e0bc4e

Browse files
peterebenjaminp
authored andcommitted
Fix misleading mentions of tp_size in comments (GH-9093)
Many type object initializations labeled a field "tp_size" in the comment, but the name of that field is tp_basicsize.
1 parent d545869 commit 0e0bc4e

15 files changed

+21
-21
lines changed

Modules/_abc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ PyDoc_STRVAR(abc_data_doc,
6868
static PyTypeObject _abc_data_type = {
6969
PyVarObject_HEAD_INIT(&PyType_Type, 0)
7070
"_abc_data", /*tp_name*/
71-
sizeof(_abc_data), /*tp_size*/
71+
sizeof(_abc_data), /*tp_basicsize*/
7272
.tp_dealloc = (destructor)abc_data_dealloc,
7373
.tp_flags = Py_TPFLAGS_DEFAULT,
7474
.tp_alloc = PyType_GenericAlloc,

Modules/_blake2/blake2b_impl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ py_blake2b_dealloc(PyObject *self)
398398
PyTypeObject PyBlake2_BLAKE2bType = {
399399
PyVarObject_HEAD_INIT(NULL, 0)
400400
"_blake2.blake2b", /* tp_name */
401-
sizeof(BLAKE2bObject), /* tp_size */
401+
sizeof(BLAKE2bObject), /* tp_basicsize */
402402
0, /* tp_itemsize */
403403
py_blake2b_dealloc, /* tp_dealloc */
404404
0, /* tp_print */

Modules/_blake2/blake2s_impl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ py_blake2s_dealloc(PyObject *self)
398398
PyTypeObject PyBlake2_BLAKE2sType = {
399399
PyVarObject_HEAD_INIT(NULL, 0)
400400
"_blake2.blake2s", /* tp_name */
401-
sizeof(BLAKE2sObject), /* tp_size */
401+
sizeof(BLAKE2sObject), /* tp_basicsize */
402402
0, /* tp_itemsize */
403403
py_blake2s_dealloc, /* tp_dealloc */
404404
0, /* tp_print */

Modules/_queuemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static PyMethodDef simplequeue_methods[] = {
309309
static PyTypeObject PySimpleQueueType = {
310310
PyVarObject_HEAD_INIT(NULL, 0)
311311
"_queue.SimpleQueue", /*tp_name*/
312-
sizeof(simplequeueobject), /*tp_size*/
312+
sizeof(simplequeueobject), /*tp_basicsize*/
313313
0, /*tp_itemsize*/
314314
/* methods */
315315
(destructor)simplequeue_dealloc, /*tp_dealloc*/

Modules/_sha3/sha3module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ static PyGetSetDef SHA3_getseters[] = {
489489
static PyTypeObject type_obj = { \
490490
PyVarObject_HEAD_INIT(NULL, 0) \
491491
type_name, /* tp_name */ \
492-
sizeof(SHA3object), /* tp_size */ \
492+
sizeof(SHA3object), /* tp_basicsize */ \
493493
0, /* tp_itemsize */ \
494494
/* methods */ \
495495
(destructor)SHA3_dealloc, /* tp_dealloc */ \

Modules/_threadmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static PyMethodDef lock_methods[] = {
226226
static PyTypeObject Locktype = {
227227
PyVarObject_HEAD_INIT(&PyType_Type, 0)
228228
"_thread.lock", /*tp_name*/
229-
sizeof(lockobject), /*tp_size*/
229+
sizeof(lockobject), /*tp_basicsize*/
230230
0, /*tp_itemsize*/
231231
/* methods */
232232
(destructor)lock_dealloc, /*tp_dealloc*/
@@ -487,7 +487,7 @@ static PyMethodDef rlock_methods[] = {
487487
static PyTypeObject RLocktype = {
488488
PyVarObject_HEAD_INIT(&PyType_Type, 0)
489489
"_thread.RLock", /*tp_name*/
490-
sizeof(rlockobject), /*tp_size*/
490+
sizeof(rlockobject), /*tp_basicsize*/
491491
0, /*tp_itemsize*/
492492
/* methods */
493493
(destructor)rlock_dealloc, /*tp_dealloc*/

Modules/_xxsubinterpretersmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,7 +1764,7 @@ PyDoc_STRVAR(channelid_doc,
17641764
static PyTypeObject ChannelIDtype = {
17651765
PyVarObject_HEAD_INIT(&PyType_Type, 0)
17661766
"_xxsubinterpreters.ChannelID", /* tp_name */
1767-
sizeof(channelid), /* tp_size */
1767+
sizeof(channelid), /* tp_basicsize */
17681768
0, /* tp_itemsize */
17691769
(destructor)channelid_dealloc, /* tp_dealloc */
17701770
0, /* tp_print */
@@ -2173,7 +2173,7 @@ PyDoc_STRVAR(interpid_doc,
21732173
static PyTypeObject InterpreterIDtype = {
21742174
PyVarObject_HEAD_INIT(&PyType_Type, 0)
21752175
"interpreters.InterpreterID", /* tp_name */
2176-
sizeof(interpid), /* tp_size */
2176+
sizeof(interpid), /* tp_basicsize */
21772177
0, /* tp_itemsize */
21782178
(destructor)interpid_dealloc, /* tp_dealloc */
21792179
0, /* tp_print */

Modules/md5module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ static PyGetSetDef MD5_getseters[] = {
465465
static PyTypeObject MD5type = {
466466
PyVarObject_HEAD_INIT(NULL, 0)
467467
"_md5.md5", /*tp_name*/
468-
sizeof(MD5object), /*tp_size*/
468+
sizeof(MD5object), /*tp_basicsize*/
469469
0, /*tp_itemsize*/
470470
/* methods */
471471
MD5_dealloc, /*tp_dealloc*/

Modules/mmapmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ To map anonymous memory, pass -1 as the fileno (both versions).");
983983
static PyTypeObject mmap_object_type = {
984984
PyVarObject_HEAD_INIT(NULL, 0)
985985
"mmap.mmap", /* tp_name */
986-
sizeof(mmap_object), /* tp_size */
986+
sizeof(mmap_object), /* tp_basicsize */
987987
0, /* tp_itemsize */
988988
/* methods */
989989
(destructor) mmap_object_dealloc, /* tp_dealloc */

Modules/ossaudiodev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ oss_getattro(oss_audio_t *self, PyObject *nameobj)
964964
static PyTypeObject OSSAudioType = {
965965
PyVarObject_HEAD_INIT(&PyType_Type, 0)
966966
"ossaudiodev.oss_audio_device", /*tp_name*/
967-
sizeof(oss_audio_t), /*tp_size*/
967+
sizeof(oss_audio_t), /*tp_basicsize*/
968968
0, /*tp_itemsize*/
969969
/* methods */
970970
(destructor)oss_dealloc, /*tp_dealloc*/
@@ -996,7 +996,7 @@ static PyTypeObject OSSAudioType = {
996996
static PyTypeObject OSSMixerType = {
997997
PyVarObject_HEAD_INIT(&PyType_Type, 0)
998998
"ossaudiodev.oss_mixer_device", /*tp_name*/
999-
sizeof(oss_mixer_t), /*tp_size*/
999+
sizeof(oss_mixer_t), /*tp_basicsize*/
10001000
0, /*tp_itemsize*/
10011001
/* methods */
10021002
(destructor)oss_mixer_dealloc, /*tp_dealloc*/

Modules/sha1module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ static PyGetSetDef SHA1_getseters[] = {
442442
static PyTypeObject SHA1type = {
443443
PyVarObject_HEAD_INIT(NULL, 0)
444444
"_sha1.sha1", /*tp_name*/
445-
sizeof(SHA1object), /*tp_size*/
445+
sizeof(SHA1object), /*tp_basicsize*/
446446
0, /*tp_itemsize*/
447447
/* methods */
448448
SHA1_dealloc, /*tp_dealloc*/

Modules/sha256module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ static PyMemberDef SHA_members[] = {
529529
static PyTypeObject SHA224type = {
530530
PyVarObject_HEAD_INIT(NULL, 0)
531531
"_sha256.sha224", /*tp_name*/
532-
sizeof(SHAobject), /*tp_size*/
532+
sizeof(SHAobject), /*tp_basicsize*/
533533
0, /*tp_itemsize*/
534534
/* methods */
535535
SHA_dealloc, /*tp_dealloc*/
@@ -563,7 +563,7 @@ static PyTypeObject SHA224type = {
563563
static PyTypeObject SHA256type = {
564564
PyVarObject_HEAD_INIT(NULL, 0)
565565
"_sha256.sha256", /*tp_name*/
566-
sizeof(SHAobject), /*tp_size*/
566+
sizeof(SHAobject), /*tp_basicsize*/
567567
0, /*tp_itemsize*/
568568
/* methods */
569569
SHA_dealloc, /*tp_dealloc*/

Modules/sha512module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ static PyMemberDef SHA_members[] = {
594594
static PyTypeObject SHA384type = {
595595
PyVarObject_HEAD_INIT(NULL, 0)
596596
"_sha512.sha384", /*tp_name*/
597-
sizeof(SHAobject), /*tp_size*/
597+
sizeof(SHAobject), /*tp_basicsize*/
598598
0, /*tp_itemsize*/
599599
/* methods */
600600
SHA512_dealloc, /*tp_dealloc*/
@@ -628,7 +628,7 @@ static PyTypeObject SHA384type = {
628628
static PyTypeObject SHA512type = {
629629
PyVarObject_HEAD_INIT(NULL, 0)
630630
"_sha512.sha512", /*tp_name*/
631-
sizeof(SHAobject), /*tp_size*/
631+
sizeof(SHAobject), /*tp_basicsize*/
632632
0, /*tp_itemsize*/
633633
/* methods */
634634
SHA512_dealloc, /*tp_dealloc*/

Objects/moduleobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bad_traverse_test(PyObject *self, void *arg) {
3535
PyTypeObject PyModuleDef_Type = {
3636
PyVarObject_HEAD_INIT(&PyType_Type, 0)
3737
"moduledef", /* tp_name */
38-
sizeof(struct PyModuleDef), /* tp_size */
38+
sizeof(struct PyModuleDef), /* tp_basicsize */
3939
0, /* tp_itemsize */
4040
};
4141

@@ -790,7 +790,7 @@ static PyMethodDef module_methods[] = {
790790
PyTypeObject PyModule_Type = {
791791
PyVarObject_HEAD_INIT(&PyType_Type, 0)
792792
"module", /* tp_name */
793-
sizeof(PyModuleObject), /* tp_size */
793+
sizeof(PyModuleObject), /* tp_basicsize */
794794
0, /* tp_itemsize */
795795
(destructor)module_dealloc, /* tp_dealloc */
796796
0, /* tp_print */

Objects/namespaceobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ SimpleNamespace(**kwargs)");
201201
PyTypeObject _PyNamespace_Type = {
202202
PyVarObject_HEAD_INIT(&PyType_Type, 0)
203203
"types.SimpleNamespace", /* tp_name */
204-
sizeof(_PyNamespaceObject), /* tp_size */
204+
sizeof(_PyNamespaceObject), /* tp_basicsize */
205205
0, /* tp_itemsize */
206206
(destructor)namespace_dealloc, /* tp_dealloc */
207207
0, /* tp_print */

0 commit comments

Comments
 (0)