Nick Coghlan <ncogh...@gmail.com> 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 <rep...@bugs.python.org>
<https://bugs.python.org/issue33261>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to