Support typing.Annotated inference

This commit is contained in:
Luc Khai Hai
2023-06-17 20:28:17 +09:00
parent a28bd24bef
commit 72d34f3d7d
2 changed files with 28 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
# python >= 3.9
from typing import Annotated
# This is just a dummy and very meaningless thing to use with to the Annotated
# type hint
class Foo:
pass
class A:
pass
def annotated_function_params(
basic: Annotated[str, Foo()],
obj: A,
annotated_obj: Annotated[A, Foo()],
):
#? str()
basic
#? A()
obj
#? A()
annotated_obj