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(
249
249
formal_name = (set (actual_type .items .keys ()) - self .kwargs_used ).pop ()
250
250
self .kwargs_used .add (formal_name )
251
251
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
256
254
):
257
255
# Only `Mapping` type can be unpacked with `**`.
258
256
# 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
345
345
class MappingSubclass(Mapping[str, str]): pass
346
346
def f(**kwargs: 'A') -> None: pass
347
347
d: MappingSubclass
348
- f(**d)
348
+ f(**d) # E: Argument 1 to "f" has incompatible type "**MappingSubclass"; expected "A"
349
349
class A: pass
350
350
[builtins fixtures/dict.pyi]
351
351
You can’t perform that action at this time.
0 commit comments