Message117984
In http://docs.python.org/dev/extending/newtypes.html, you can read:
“To enable object creation, we have to provide a tp_new implementation. In this case, we can just use the default implementation provided by the API function PyType_GenericNew(). 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 the thing is, we ourselves (CPython) do exactly what is discouraged here, both in built-in types and dynamically loaded extensions.
So is this piece of advice still necessary? |
|
Date |
User |
Action |
Args |
2010-10-04 21:45:52 | pitrou | set | recipients:
+ pitrou, loewis, docs@python |
2010-10-04 21:45:51 | pitrou | set | messageid: <1286228751.32.0.127029935422.issue10024@psf.upfronthosting.co.za> |
2010-10-04 21:45:49 | pitrou | link | issue10024 messages |
2010-10-04 21:45:47 | pitrou | create | |
|