mypy
mypy copied to clipboard
Support __call__ on metaclasses
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