This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Smile-zjk
Recipients Smile-zjk, docs@python
Date 2021-01-12.14:43:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1610462639.95.0.034878546746.issue42910@roundup.psfhosted.org>
In-reply-to
Content
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]
History
Date User Action Args
2021-01-12 14:43:59Smile-zjksetrecipients: + Smile-zjk, docs@python
2021-01-12 14:43:59Smile-zjksetmessageid: <1610462639.95.0.034878546746.issue42910@roundup.psfhosted.org>
2021-01-12 14:43:59Smile-zjklinkissue42910 messages
2021-01-12 14:43:59Smile-zjkcreate