-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
Description
from typing import Tuple, Dict, Any
class MyMeta(type):
def __new__(cls, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> type:
return type.__new__(name, bases, dict)This MyMeta.__new__ has exactly same signature with type.__new__ in typeshed:
https://github.com/python/typeshed/blob/master/stdlib/3/builtins.pyi#L88
But mypy thinks that it's incorrect and offers me to write two same cls args:
test.py:6: note: Possible overload variants:
test.py:6: note: def __new__(cls, cls: Any, o: object) -> type
test.py:6: note: def __new__(cls, cls: Any, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type
No mypy flags was used, mypy --version is 0.620
Reactions are currently unavailable