You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
inner.py:12: error: Cannot determine type of 'Inner' in base class 'OuterBase'
inner.py:12: error: Cannot determine type of 'Inner' in base class 'OuterMixin'
Line 12 is the line that starts with class Outer.
I don't understand why the types cannot be determined: Type[OuterBase.Inner] and Type[OuterMixin.Inner] respectively would be the types for the inner classes, I think.
Note that the errors go away when Outer inherits only from OuterBase or only from OuterMixin.
I'm using mypy 0.641 on Python 3.6.5.
The text was updated successfully, but these errors were encountered:
(As a side note this is still technically not type safe, this is like you would a have multiple inheritance with inner: str and inner: int in two bases.)
Sorry for opening a duplicate; neither the manual search I did nor the GitHub "related issues" beta function turned up the existing report.
This minimal test case leaves out some details that the production code uses. Even so, I think it's type-safe as long as the Outer class will only use Inner according to the InnerBase interface.
I run mypy on the following code, with no arguments other than the file name:
The output that I get is as follows:
Line 12 is the line that starts with
class Outer
.I don't understand why the types cannot be determined:
Type[OuterBase.Inner]
andType[OuterMixin.Inner]
respectively would be the types for the inner classes, I think.Note that the errors go away when
Outer
inherits only fromOuterBase
or only fromOuterMixin
.I'm using mypy 0.641 on Python 3.6.5.
The text was updated successfully, but these errors were encountered: