File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -790,20 +790,19 @@ def check_typeddict_call_with_kwargs(
790
790
orig_callee : Type | None ,
791
791
) -> Type :
792
792
actual_keys = kwargs .keys ()
793
- found_set = set (actual_keys )
794
- if not (callee .required_keys <= found_set <= set (callee .items .keys ())):
793
+ if not (callee .required_keys <= actual_keys <= callee .items .keys ()):
795
794
expected_keys = [
796
795
key
797
796
for key in callee .items .keys ()
798
- if key in callee .required_keys or key in found_set
797
+ if key in callee .required_keys or key in actual_keys
799
798
]
800
799
self .msg .unexpected_typeddict_keys (
801
800
callee , expected_keys = expected_keys , actual_keys = list (actual_keys ), context = context
802
801
)
803
- if callee .required_keys > found_set :
804
- # found_set is not a sub-set of the required_keys
805
- # This means we're dealing with something weird we can't
806
- # properly type
802
+ if callee .required_keys > actual_keys :
803
+ # found_set is a sub-set of the required_keys
804
+ # This means we're missing some keys and as such, we can't
805
+ # properly type the object
807
806
return AnyType (TypeOfAny .from_error )
808
807
809
808
orig_callee = get_proper_type (orig_callee )
You can’t perform that action at this time.
0 commit comments