Message193232
issue-18181-full-v1.txt implements support for __locallookup__ to both super and _PyType_Lookup and should implement the entire PEP.
The patch is not yet 100% and is missing:
* Tests that add __locallookup__ to a metaclass at runtime, should
enable the new behavior
* Tests that use the tp_locallookup slot in an type defined in C code
* Documentation has not been updated.
Changes to the implementation:
* _PyType_Lookup is now _PyType_LookupName
and returns a new reference (not a borrowed one)
* _PyType_Lookup and super.__getattribute__ use the
__locallookup__ method when present
* __locallookup__ is not defined on "type",
and the type attribute lookup cache is disabled
for types that have a metatype with __locallookup__
* The type attribute cache is disabled for types that are
not ready (Py_TPFLAGS_READY), primarily
as a side effect of the implementation.
The cache is also disabled for types with a metaclass that
has a tp_locallookup attribute, as mentioned in the PEP.
The code does not change the VERSION flags of the type because
dynamicly adding a __locallookup__ method to the metaclass would
have to change all instances of that metaclass and that's not
easily possible. |
|
Date |
User |
Action |
Args |
2013-07-17 14:57:53 | ronaldoussoren | set | recipients:
+ ronaldoussoren, amaury.forgeotdarc |
2013-07-17 14:57:53 | ronaldoussoren | set | messageid: <1374073073.01.0.83849597985.issue18181@psf.upfronthosting.co.za> |
2013-07-17 14:57:52 | ronaldoussoren | link | issue18181 messages |
2013-07-17 14:57:52 | ronaldoussoren | create | |
|