Message334396
Consider this code:
```
from __future__ import annotations
import typing
class A:
f: 'Undef'
hints = typing.get_type_hints(A)
```
Since Undef is not defined, I should get an exception when calling get_type_hints, something like "NameError: name 'Undef' is not defined". But instead, get_type_hints returns {'f': ForwardRef('Undef')}.
If I remove the `from __future__ import annotations` line, get_type_hints correctly raises this exception.
I think the behavior should be to raise an exception in both cases. |
|
Date |
User |
Action |
Args |
2019-01-26 17:00:22 | Lincoln Quirk | set | recipients:
+ Lincoln Quirk |
2019-01-26 17:00:18 | Lincoln Quirk | set | messageid: <1548522018.14.0.654103456004.issue35834@roundup.psfhosted.org> |
2019-01-26 17:00:18 | Lincoln Quirk | link | issue35834 messages |
2019-01-26 17:00:18 | Lincoln Quirk | create | |
|