[Python-Dev] PEP 447: add type.__locallookup__

Antoine Pitrou solipsis at pitrou.net
Mon Sep 9 19:49:59 CEST 2013

On Mon, 09 Sep 2013 09:05:57 -0700
Ethan Furman <ethan at stoneleaf.us> wrote:
> On 09/09/2013 08:43 AM, Mark Shannon wrote:
> > I would like time to investigate this further, but at the moment I think it will either make attribute lookup poorly
> > defined or slow.
> >
> > Of the top of my head, the problem as a I see it is basically this:
> > Currently, type.__getattribute__() is a fixed point in the lookup of attributes.
> > The proposal means that a fixed point is not reached until the cls parameter of type.__getattribute__() is either object
> > or type,
> > otherwise type.__getattribute__() and type.__locallookup__ must bounce back and forth.
> >
> > This will slow down *every* attribute lookup for what is a fairly obscure use case.
> Looks like there's a patch we can try at http://bugs.python.org/issue18181.
> Here are Ronald's last timings:

Thanks but can you run a benchmark that actually exercises the feature?
(I don't know enough about it to know what that would be, but I suppose
it has to do with lookups on classes, rather than on instances)



More information about the Python-Dev mailing list