mirror of
https://github.com/davidhalter/jedi.git
synced 2026-08-12 10:14:36 +08:00
TypedDict: fix non-inheritance tests, add inheritance
Note: tests currently failing
This commit is contained in:
@@ -510,7 +510,6 @@ class Foo(typing.TypedDict):
|
|||||||
foo: str
|
foo: str
|
||||||
bar: typing.List[float]
|
bar: typing.List[float]
|
||||||
an_int: int
|
an_int: int
|
||||||
foo
|
|
||||||
#! ['foo: str']
|
#! ['foo: str']
|
||||||
foo
|
foo
|
||||||
#? str()
|
#? str()
|
||||||
@@ -525,8 +524,10 @@ def typed_dict_test_foo(arg: Foo):
|
|||||||
|
|
||||||
#? str()
|
#? str()
|
||||||
a_string
|
a_string
|
||||||
#? [float()]
|
#? list()
|
||||||
a_list_of_strings
|
a_list_of_floats
|
||||||
|
#? float()
|
||||||
|
a_list_of_floats[0]
|
||||||
#? int()
|
#? int()
|
||||||
an_int
|
an_int
|
||||||
|
|
||||||
@@ -558,7 +559,41 @@ Foo.set
|
|||||||
#? ['setdefault']
|
#? ['setdefault']
|
||||||
d.setdefaul
|
d.setdefaul
|
||||||
|
|
||||||
#? 5 ["'foo'"]
|
#? 5 ["'foo"]
|
||||||
d['fo']
|
d['fo']
|
||||||
#? 5 ['"bar"']
|
#? 5 ['"bar"']
|
||||||
d["bar"]
|
d["bar"]
|
||||||
|
|
||||||
|
class Bar(Foo):
|
||||||
|
another_variable: int
|
||||||
|
|
||||||
|
#? int()
|
||||||
|
another_variable
|
||||||
|
#? str()
|
||||||
|
foo
|
||||||
|
#? int()
|
||||||
|
an_int
|
||||||
|
|
||||||
|
def typed_dict_test_foo(arg: Bar):
|
||||||
|
a_string = arg['foo']
|
||||||
|
a_list_of_floats = arg['bar']
|
||||||
|
an_int = arg['an_int']
|
||||||
|
another_variable = arg['another_variable']
|
||||||
|
|
||||||
|
#? str()
|
||||||
|
a_string
|
||||||
|
#? list()
|
||||||
|
a_list_of_floats
|
||||||
|
#? float()
|
||||||
|
a_list_of_floats[0]
|
||||||
|
#? int()
|
||||||
|
an_int
|
||||||
|
#? int()
|
||||||
|
another_variable
|
||||||
|
|
||||||
|
#? ['isupper']
|
||||||
|
a_string.isuppe
|
||||||
|
#? ['pop']
|
||||||
|
a_list_of_floats.po
|
||||||
|
#? ['as_integer_ratio']
|
||||||
|
an_int.as_integer_rati
|
||||||
|
|||||||
Reference in New Issue
Block a user