-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Bug Report
The following code produces an error when var()
is called, but not when it is declared. If you can declare __init__
on Protocol
s, shouldn't implementations have to match, at least when assigned as Type
s?
from typing import Protocol, Type
class Proto(Protocol):
def __init__(self, x: int) -> None:
...
class Impl:
def __init__(self) -> None:
...
var: Type[Proto] = Impl
var()
Your Environment
- Mypy version used:
mypy 0.961 (compiled: yes)
- Mypy command-line flags: None
- Mypy configuration options from
mypy.ini
(and other config files): None - Python version used: Python 3.10.4 (python.org)
- Operating system and version:
ProductName: macOS
ProductVersion: 12.4
BuildVersion: 21F79