Skip to content

Commit b6a6008

Browse files
peterebenjaminp
authored andcommitted
[3.7] 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.. (cherry picked from commit 0e0bc4e) Co-authored-by: Peter Eisentraut <[email protected]>
1 parent c0d63bf commit b6a6008

14 files changed

+19
-19
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
@@ -413,7 +413,7 @@ py_blake2b_dealloc(PyObject *self)
413413
PyTypeObject PyBlake2_BLAKE2bType = {
414414
PyVarObject_HEAD_INIT(NULL, 0)
415415
"_blake2.blake2b", /* tp_name */
416-
sizeof(BLAKE2bObject), /* tp_size */
416+
sizeof(BLAKE2bObject), /* tp_basicsize */
417417
0, /* tp_itemsize */
418418
py_blake2b_dealloc, /* tp_dealloc */
419419
0, /* tp_print */

Modules/_blake2/blake2s_impl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ py_blake2s_dealloc(PyObject *self)
413413
PyTypeObject PyBlake2_BLAKE2sType = {
414414
PyVarObject_HEAD_INIT(NULL, 0)
415415
"_blake2.blake2s", /* tp_name */
416-
sizeof(BLAKE2sObject), /* tp_size */
416+
sizeof(BLAKE2sObject), /* tp_basicsize */
417417
0, /* tp_itemsize */
418418
py_blake2s_dealloc, /* tp_dealloc */
419419
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/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
@@ -980,7 +980,7 @@ To map anonymous memory, pass -1 as the fileno (both versions).");
980980
static PyTypeObject mmap_object_type = {
981981
PyVarObject_HEAD_INIT(NULL, 0)
982982
"mmap.mmap", /* tp_name */
983-
sizeof(mmap_object), /* tp_size */
983+
sizeof(mmap_object), /* tp_basicsize */
984984
0, /* tp_itemsize */
985985
/* methods */
986986
(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*/

0 commit comments

Comments
 (0)