Yury Selivanov added the comment: This behaviour is indeed a bug. However, I think that the solution you propose is wrong.
If we ignore invalid contents of __signature__ we are masking a bug or incorrect behaviour. In this case, you should have checked the requested attribute name in '__getattr__', and return something other than _Method, if it is a '__signature__'. Please find attached a patch, that checks if __signature__ is an instance of Signature class, and raises a TypeError if it isn't. ---------- nosy: +larry, ncoghlan Added file: http://bugs.python.org/file35710/issue21801.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21801> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com