On Fri, 06 Sep 2013 08:14:09 -0700 Ethan Furman <ethan at stoneleaf.us> wrote: > On 09/06/2013 07:47 AM, Armin Rigo wrote: > > > > Are you suggesting that inspect.getmro(A) would return (A, object, > > type)? That seems very wrong to me. > > Currently, `inspect.getmro(A)` returns `(A, object)`. > > Considering that Python actually will look in A's metaclass to find a class attribute, I think returning `(A, object, > type(A)` is appropriate: No, I don't think it's appropriate at all. You are conflating two things: - the instance lookup of an attribute (on A, here) - the class lookup when the instance lookup fails (on type, here) Both lookups obey the same MRO rules, it just happens that the second lookup uses a trivial MRO: >>> type.__mro__ (<class 'type'>, <class 'object'>) Regards Antoine.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4