Nick Coghlan <> added the comment:

The inspect functions throwing an exception when handed a method wrapping a 
non-function callable instead of returning False is a definite bug.

The behaviour of MethodType when handed a non-function callable is cryptic, but 
not actually a bug: the problem is that it expects to be able to delegate 
accesses to __name__ and __code__ to the underlying callable.

A docs bug to clarify exactly which accesses are going to get delegated would 
make sense (and perhaps make MethodType.__dir__ a bit smarter about that 
delegation), but it's a separate issue from the one Jeroen has reported here.


Python tracker <>
Python-bugs-list mailing list

Reply via email to