Message134052
| Author |
ncoghlan |
| Recipients |
amaury.forgeotdarc, benjamin.peterson, daniel.urban, georg.brandl, gvanrossum, ncoghlan, pwerneck, rodsenra, terry.reedy |
| Date |
2011年04月19日.13:26:48 |
| SpamBayes Score |
3.4955927e-11 |
| Marked as misclassified |
No |
| Message-id |
<1303219609.04.0.959062575311.issue1294232@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Yep, the leading underscore and the fact you added it to a block of code that is skipped when Py_LIMITED_API is defined makes it OK to include the prototype in object.h.
However, I would suggest _PyType_CalculateMetaclass as the name - CalculateWinner is a bit vague without the specific context of calculating the metaclass.
On a broader point, I think there is an issue that needs to be brought up on python-dev: in light of PEP 3115, "type(name, bases, ns)" is no longer an entirely safe way to create dynamic types, as it bypasses __prepare__ methods. There should be an official way to access the full class building process, including correct invocation of __prepare__ methods (likely by making __build_class__ an official part of the language spec rather than a CPython implementation detail). |
|