-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-2-low
Description
It appears as though mypy treats argument unpacking as containing at least one element. Here's an example:
from typing import List
class Foo:
pass
args: List[str] = []
packet = Foo(*args)
tbug.py:7: error: Too many arguments for "Foo"
I guess Mypy is assuming that you would never unpack zero arguments.
In my particular case I have a registry of 'packet classes' and a dynamic number of arguments parsed from the network. Some of those packet classes legitimately have 0 parameters, and Mypy gives me an error about each of them.
Running mypy 0.600
with no other flags.
maxfischer2781 and NeilGirdhar
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-2-low