On Fri, 06 Sep 2013 08:14:09 -0700 Ethan Furman email@example.com 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:
(<class 'type'>, <class 'object'>)