Message385536
And I promise this is the last one:
import inspect
import typing
def f():
A = typing.TypeVar("A")
def same_type_args(a: A, b: A):
assert type(a) == type(b)
print(inspect.signature(same_type_args))
print(typing.get_type_hints(same_type_args))
f()
$ python3 t.py
(a: ~A, b: ~A)
{'a': ~A, 'b': ~A}
$ python3.10 t.py
(a: 'A', b: 'A')
Traceback (most recent call last):
...
NameError: name 'A' is not defined
My apologies to everyone involved here; I'm looking forward to postponed annotation evaluation, appreciate all your work on this, and regret that I have such bizzare bugs to report <3 |
|
Date |
User |
Action |
Args |
2021-01-23 13:45:35 | Zac Hatfield-Dodds | set | recipients:
+ Zac Hatfield-Dodds, gvanrossum, BTaskaya, kj |
2021-01-23 13:45:35 | Zac Hatfield-Dodds | set | messageid: <1611409535.64.0.0663219661728.issue43006@roundup.psfhosted.org> |
2021-01-23 13:45:35 | Zac Hatfield-Dodds | link | issue43006 messages |
2021-01-23 13:45:35 | Zac Hatfield-Dodds | create | |
|