-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugmypy got something wrongmypy got something wrongpriority-2-lowtopic-pluginsThe plugin API and ideas for new pluginsThe plugin API and ideas for new plugins
Description
Small case to reproduce:
from typing import Tuple
from dataclasses import dataclass
@dataclass
class Foo:
spams: Tuple[int, ...]
def __init__(self, *spams: int) -> None:
self.spams = spams
def build_foo(*spams: int) -> Foo:
return Foo(*spams)Checking that program with mypy 0.670 (Python 3.6), results in:
bug.py:13: error: Argument 1 to "Foo" has incompatible type "*Tuple[int, ...]"; expected "Tuple[int, ...]"
Without the @dataclass decorator the program passes. It seems that the dataclass is hiding the actual __init__.
chdsbd and connorbrinton
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongpriority-2-lowtopic-pluginsThe plugin API and ideas for new pluginsThe plugin API and ideas for new plugins