I have fresh installed Python 3.7-32 on Windows 10.
I want to try Protocols python approach and I do next:
file test_protocols.py with only one row:
from typing import Protocol
then:
>python test_protocols.py
And I have next error message that is needed to be explained:
Traceback (most recent call last):
File "test_protocols.py", line 1, in <module>
from typing import Protocol
ImportError: cannot import name 'Protocol' from 'typing' (C:\Programing\Python\Python37-32\lib\typing.py)
What do I do wrong?
Maybe I have read PEP-0544 wrong but from my point of view I do the same as it is documented.
As of January 20, 2019, PEP 544's status is Draft
. As far as I understand, it's not implemented in CPython yet.
UPD: it should work since Python 3.8, try updating.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With