Ian Good <[email protected]> added the comment:
I believe this was a deeper issue that affected all classes inheriting
Protocol, causing a TypeError on even the most basic case (see attached):
Traceback (most recent call last):
File "/.../test.py", line 14, in <module>
MyClass()
File "/.../test.py", line 11, in __init__
super().__init__()
File
"/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py",
line 1083, in _no_init
raise TypeError('Protocols cannot be instantiated')
TypeError: Protocols cannot be instantiated
This was a new regression in 3.9.7 and seems to be resolved by this fix. The
desired behavior should be supported according to PEP 544:
https://www.python.org/dev/peps/pep-0544/#explicitly-declaring-implementation
----------
nosy: +icgood
Added file: https://bugs.python.org/file50277/test.py
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue45081>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com