[issue36848] autospec fails with AttributeError when mocked class has __signature__ non-writeable

Mario Corchero report at bugs.python.org
Wed May 8 10:32:27 EDT 2019


Mario Corchero <mariocj89 at gmail.com> added the comment:

Agree, for the general case I think it makes sense that this is fixed in pyside.
Hijacking __signature__ python-wide sounds like it can cause other issues, if they need such a hack I would suggest finding a way (in pyside) to allow for mock to work.

I wonder though if this change in __signature__ will affect in any way any C extension that might not allow setting __signature__ if not set as a lack of __dict__ (I have not managed to find any issue with small examples though).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36848>
_______________________________________


More information about the Python-bugs-list mailing list