File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -249,10 +249,8 @@ def expand_actual_type(
249249 formal_name = (set (actual_type .items .keys ()) - self .kwargs_used ).pop ()
250250 self .kwargs_used .add (formal_name )
251251 return actual_type .items [formal_name ]
252- elif (
253- isinstance (actual_type , Instance )
254- and len (actual_type .args ) > 1
255- and is_subtype (actual_type , self .context .mapping_type )
252+ elif isinstance (actual_type , Instance ) and is_subtype (
253+ actual_type , self .context .mapping_type
256254 ):
257255 # Only `Mapping` type can be unpacked with `**`.
258256 # Other types will produce an error somewhere else.
Original file line number Diff line number Diff line change @@ -345,7 +345,7 @@ from typing import Mapping
345345class MappingSubclass(Mapping[str, str]): pass
346346def f(**kwargs: 'A') -> None: pass
347347d: MappingSubclass
348- f(**d)
348+ f(**d) # E: Argument 1 to "f" has incompatible type "**MappingSubclass"; expected "A"
349349class A: pass
350350[builtins fixtures/dict.pyi]
351351
You can’t perform that action at this time.
0 commit comments