Message374884
The following code is currently consistent with the type hint syntax but contains a line that is completely ignored.
>>> d = {}
>>> d['a']: int
>>> d
{}
>>> __annotations__
{}
>>> '__annotations__' in dir(d)
False
I believe that type hints that cannot be either attached to an object nor added to any other __annotations__ dict should either generate a SyntaxError or, at the very least, result in a warning. |
|
Date |
User |
Action |
Args |
2020-08-05 14:25:11 | aroberge | set | recipients:
+ aroberge |
2020-08-05 14:25:10 | aroberge | set | messageid: <1596637510.96.0.457695576567.issue41488@roundup.psfhosted.org> |
2020-08-05 14:25:10 | aroberge | link | issue41488 messages |
2020-08-05 14:25:10 | aroberge | create | |
|