This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Romuald
Recipients Romuald, docs@python
Date 2017-09-13.09:03:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1505293390.55.0.87127393271.issue31443@psf.upfronthosting.co.za>
In-reply-to
Content
In the "Defining New Types documentation" basics about tp_new -> PyType_GenericNew, the doc states:

> We’d like to just assign this to the tp_new slot, but we can’t, for
> portability sake, On some platforms or compilers, we can’t statically
> initialize a structure member with a function defined in another C
> module, so, instead, we’ll assign the tp_new slot in the module
> initialization function just before calling PyType_Ready():


But looking a python C code itself [1] does seem to do this. So I'm guessing that part of the documentation is now irrelevant and the example could just assign PyType_GenericNew to tp_new.

[1] https://github.com/python/cpython/blob/2ebc5ce42a8a9e047e790aefbf9a94811569b2b6/Objects/listobject.c#L2733
History
Date User Action Args
2017-09-13 09:03:10Romualdsetrecipients: + Romuald, docs@python
2017-09-13 09:03:10Romualdsetmessageid: <1505293390.55.0.87127393271.issue31443@psf.upfronthosting.co.za>
2017-09-13 09:03:10Romualdlinkissue31443 messages
2017-09-13 09:03:10Romualdcreate