[issue45518] Invalid example for typing

2021-10-18 Thread Bozhi You


New submission from Bozhi You :

The first example snippet under 
https://docs.python.org/3/library/typing.html#type-aliases is invalid to run.

```
Traceback (most recent call last):
  File "main.py", line 1, in 
Vector = list[float]
TypeError: 'type' object is not subscriptable
```

A solution to this may be replacing `list` with `List` from `typing`.

--
assignee: docs@python
components: Documentation
messages: 404232
nosy: bozhiyou, docs@python
priority: normal
severity: normal
status: open
title: Invalid example for typing
type: compile error
versions: Python 3.10

___
Python tracker 
<https://bugs.python.org/issue45518>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45518] Invalid example for typing

2021-11-17 Thread Bozhi You


Bozhi You  added the comment:

My bad. Didn't notice the version constraint. Thank you, Logan!

--
stage:  -> resolved
status: pending -> closed

___
Python tracker 
<https://bugs.python.org/issue45518>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com