Bug Report
Consider the following input:
fromtypingimportProtocolclassInterface(Protocol):
defdummy(self, arg: str) ->str:
...
stubgen produces:
classInterface:
defdummy(self, arg: str) ->str: ...
Note that the Protocol class is removed from the list of base classes.
Obviously this causes problems when performing type checking against users of that generated typestub:
frominterfaceimportInterfaceclassInterfaceImpl:
defdummy(self, arg: str) ->str:
returnarginterf: Interface=InterfaceImpl()
mypy:
provider/__init__.py:8: error: Incompatible types in assignment (expression has type "InterfaceImpl", variable has type "Interface")
Expected Behavior
Protocol base class is not removed.
Actual Behavior
Protocol base class is removed.
Your Environment
- Mypy version used: mypy 0.931
- Python version used: Python 3.9.7
- Operating system and version: macOS
Bug Report
Consider the following input:
stubgenproduces:Note that the
Protocolclass is removed from the list of base classes.Obviously this causes problems when performing type checking against users of that generated typestub:
mypy:
Expected Behavior
Protocolbase class is not removed.Actual Behavior
Protocolbase class is removed.Your Environment