File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -411,9 +411,9 @@ custom types no longer works:
411411 int my_data;
412412 } CustomObject;
413413
414- static PyTypeObject CustomType = {
414+ static PyType_Spec CustomType_spec = {
415415 ...
416- .tp_basicsize = sizeof(CustomObject),
416+ .basicsize = sizeof(CustomObject),
417417 ...
418418 };
419419
@@ -441,15 +441,15 @@ and changing the name will highlight the usages as compiler errors.
441441typing the type name, this won't work. Be extra careful, and consider running
442442tools to detect undefined behavior.)
443443
444- Then, to create the class, use *negative * :c:macro: ` tp_basicsize ` to indicate
444+ Then, to create the class, use *negative * `` basicsize ` ` to indicate
445445“extra” storage space rather than *total * instance size:
446446
447447.. code-block ::
448448 :class: good
449449
450- static PyTypeObject CustomType = {
450+ static PyType_Spec CustomType_spec = {
451451 ...
452- .tp_basicsize = -sizeof(CustomObjectData), /* note the minus sign */
452+ .basicsize = -sizeof(CustomObjectData), /* note the minus sign */
453453 ...
454454 };
455455
You can’t perform that action at this time.
0 commit comments