[issue28265] builtin_function_or_method's __getattribute__ not applicable to self

Eric Snow report at bugs.python.org
Sat Sep 24 17:52:27 EDT 2016


Eric Snow added the comment:

Hmm.  It's not clear what you're after here.  The error from your example code is correct.  The valid invocation is:

b.__getattribute__(abs, 'x')

That works just fine.  If you want to look up *class* attributes then you must call __getattribute__ on the class's class:

type(b).__getattribute__(b, 'x')

This is how attribute lookup works.  I recommend closing this as not-a-bug.  If you have further question your best bet is to ask on the python-list mailing list.

----------
nosy: +eric.snow
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28265>
_______________________________________


More information about the Python-bugs-list mailing list