[New-bugs-announce] [issue42910] Wrong code appears in the type alias introduction
Casuall
report at bugs.python.org
Tue Jan 12 09:43:59 EST 2021
New submission from Casuall <Smile_zjk at qq.com>:
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]
----------
assignee: docs at python
components: Documentation
messages: 384944
nosy: Smile-zjk, docs at python
priority: normal
severity: normal
status: open
title: Wrong code appears in the type alias introduction
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42910>
_______________________________________
More information about the New-bugs-announce
mailing list