New submission from Romuald Brunet: 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 ---------- assignee: docs@python components: Documentation messages: 302038 nosy: Romuald, docs@python priority: normal severity: normal status: open title: Possibly out of date C extension documentation type: enhancement _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31443> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com