Message169925
| Author |
belopolsky |
| Recipients |
belopolsky, loewis |
| Date |
2012年09月06日.15:49:23 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1346946566.36.0.583610018294.issue15870@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
PyType_FromSpec() is a convenient function to create types dynamically in C extension modules, but its usefulness is limited by the fact that it creates new types using the default metaclass.
I suggest adding a new C API function
PyObject *PyType_FromSpecEx(PyObject *meta, PyType_Spec *spec)
and redefine PyType_FromSpec() as
PyType_FromSpecEx((PyObject *)&PyType_Type, spec)
This functionality cannot be implemented by user because PyType_FromSpec requires access to private slotoffsets table.
A (trivial) patch attached. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年09月06日 15:49:26 | belopolsky | set | recipients:
+ belopolsky, loewis |
| 2012年09月06日 15:49:26 | belopolsky | set | messageid: <1346946566.36.0.583610018294.issue15870@psf.upfronthosting.co.za> |
| 2012年09月06日 15:49:25 | belopolsky | link | issue15870 messages |
| 2012年09月06日 15:49:24 | belopolsky | create |
|