I've got a class which has a method that creates instances of the class.
class Bar:
@classmethod
def create(cls, foo: int):
return cls(foo)
def __init__(self, foo: int) -> None:
pass
When I run mypy against it, it says mypytest.py:4: error: Too many arguments for "Bar"
It seems like a bug to me, because this works fine
class Bar:
@classmethod
def create(cls, foo):
return cls(foo)
def __init__(self, foo: int) -> None:
pass
I don't understand why a class method which defines the type of a parameter should break the creation of an instance. Am I missing something?