Closed
Description
Mypy seems to treat keyword argument unpacking as containing at least one element. For example:
from typing import Dict
class Foo:
pass
args: Dict[str, str] = {}
packet = Foo(**args)
test.py:7: error: Too many arguments for "Foo"
In my case I have a function which retrieves the args dict for many classes and will give an empty dict when there are no arguments required. Mypy still complains though since it assumes the dict is not empty.
Using mypy==0.782 and 3.7.4 with no mypy flags.
A similar issue was resolved here but seems to have only solved for list or tuple unpacking.
Metadata
Metadata
Assignees
Labels
No labels