mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Support __call__ on metaclasses

Open ilevkivskyi opened this issue 3 years ago • 0 comments

Currently we don't handle __call__() on metaclasses correctly. For example:

class M(type):
    def __call__(self, x: int) -> Any: ...

class C(metaclass=M): ...

C(x=1)

results in a false positive. Also similarly handling of metaclass __call__() in protocols is not very principled, see e.g. https://github.com/python/mypy/pull/14121

ilevkivskyi avatar Nov 17 '22 19:11 ilevkivskyi