bpo-42904: Change search order of typing.get_type_hints eval#25632
bpo-42904: Change search order of typing.get_type_hints eval#25632gvanrossum merged 4 commits intopython:masterfrom
Conversation
|
@gvanrossum Oh no, I realised I shadowed the name of the original test in the previous PR, causing class A(Generic[T]):
__annotations__ = dict(
some_b='B'
)
class B(Generic[T]):
class A(Generic[T]):
pass
__annotations__ = dict(
my_inner_a1='B.A',
my_inner_a2=A,
my_outer_a='A' # unless somebody calls get_type_hints with localns=B.__dict__
)So it seems we do need to swap What do you think? |
gvanrossum
left a comment
There was a problem hiding this comment.
Okay. I still find this surprising but since it seems to be needed for the x: 'y' example, let's do it.
|
@gvanrossum: Please replace |
https://bugs.python.org/issue42904