<p dir="ltr"><br>
On 19 Sep 2013 20:00, "Paul Moore" <<a href="mailto:p.f.moore@gmail.com">p.f.moore@gmail.com</a>> wrote:<br>
><br>
> On 19 September 2013 10:32, Ronald Oussoren <<a href="mailto:ronaldoussoren@mac.com">ronaldoussoren@mac.com</a>> wrote:<br>
> > The first time a method is called the bridge looks for an Objective-C selector<br>
> > with the same name and adds that to the class dictionary. This works fine for normal<br>
> > method lookups, by overriding __getattribute__, but causes problems with super:<br>
> > super happily ignores __getattribute__ and peeks in the class __dict__ which may<br>
> > not yet contain the name we're looking for and that can result in incorrect results<br>
> > (both incorrect AttributeErrors and totally incorrect results when the name is<br>
> > not yet present in the parent class' __dict__ but is in the grandparent's __dict__).<br>
><br>
> As an alternative approach, could you use a custom dict subclass as<br>
> the class __dict__, and catch the peeking in the class __dict__ that<br>
> way? Or is this one of those places where only a real dict will do?</p>
<p dir="ltr">Even Python 3 doesn't let you control the *runtime* type of the class dict, only the type used during evaluation of the class body.</p>
<p dir="ltr">I've played with changing that - it makes for a rather special interpreter experience :)</p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
> Paul<br>
</p>