Guido van Rossum <gu...@python.org> added the comment: Such a mechanism exists, and is called Protocols. See PEP 544 (https://www.python.org/dev/peps/pep-0544/). While the PEP is still in draft, it is supported by mypy. You need to import the 'Protocol' base class from typing_extensions (which is a PyPI module, so use `pip install typing_extensions`).
---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33107> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com