Message384944
I learned about type aliases on the page(https://docs.python.org/3/library/typing.html), and I found that following the code (Vector = list[float])in the tutorial, an error occurred (NameError: name 'typing' is not defined) when running.
The following code has the same problem:
ConnectionOptions = dict[str, str]
Address = tuple[str, int]
Server = tuple[Address, ConnectionOptions]
I searched through google and found the correct code:
from typing import List
Vector = List[float]
from typing import Dict, Tuple, Sequence
ConnectionOptions = Dict[str, str]
Address = Tuple[str, int]
Server = Tuple[Address, ConnectionOptions] |
|
Date |
User |
Action |
Args |
2021-01-12 14:43:59 | Smile-zjk | set | recipients:
+ Smile-zjk, docs@python |
2021-01-12 14:43:59 | Smile-zjk | set | messageid: <1610462639.95.0.034878546746.issue42910@roundup.psfhosted.org> |
2021-01-12 14:43:59 | Smile-zjk | link | issue42910 messages |
2021-01-12 14:43:59 | Smile-zjk | create | |
|