This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients amaury.forgeotdarc, ronaldoussoren
Date 2013-07-17.14:57:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1374073073.01.0.83849597985.issue18181@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-07-17 14:57:53ronaldoussorensetrecipients: + ronaldoussoren, amaury.forgeotdarc
2013-07-17 14:57:53ronaldoussorensetmessageid: <1374073073.01.0.83849597985.issue18181@psf.upfronthosting.co.za>
2013-07-17 14:57:52ronaldoussorenlinkissue18181 messages
2013-07-17 14:57:52ronaldoussorencreate