mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
Expand on TypedDict tests.
Adds a function that takes the TypedDict as an argument. Note: the last two tests are failing, along with lots of other tests throughout the system.
This commit is contained in:
@@ -509,11 +509,33 @@ dynamic_annotation('')
|
|||||||
class Foo(typing.TypedDict):
|
class Foo(typing.TypedDict):
|
||||||
foo: str
|
foo: str
|
||||||
bar: typing.List[float]
|
bar: typing.List[float]
|
||||||
|
an_int: int
|
||||||
foo
|
foo
|
||||||
#! ['foo: str']
|
#! ['foo: str']
|
||||||
foo
|
foo
|
||||||
#? str()
|
#? str()
|
||||||
foo
|
foo
|
||||||
|
#? int()
|
||||||
|
an_int
|
||||||
|
|
||||||
|
def typed_dict_test_foo(arg: Foo):
|
||||||
|
a_string = arg['foo']
|
||||||
|
a_list_of_floats = arg['bar']
|
||||||
|
an_int = arg['an_int']
|
||||||
|
|
||||||
|
#? str()
|
||||||
|
a_string
|
||||||
|
#? [float()]
|
||||||
|
a_list_of_strings
|
||||||
|
#? int()
|
||||||
|
an_int
|
||||||
|
|
||||||
|
#? ['isupper']
|
||||||
|
a_string.isuppe
|
||||||
|
#? ['pop']
|
||||||
|
a_list_of_floats.po
|
||||||
|
#? ['as_integer_ratio']
|
||||||
|
an_int.as_integer_rati
|
||||||
|
|
||||||
#! ['class Foo']
|
#! ['class Foo']
|
||||||
d: Foo
|
d: Foo
|
||||||
|
|||||||
Reference in New Issue
Block a user