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
{{ message }}
Repository navigation
"Cannot determine type" on inner class inheritance #5914
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.
(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.
Activity
ilevkivskyi commentedon Nov 19, 2018
Duplicate of #2871
(As a side note this is still technically not type safe, this is like you would a have multiple inheritance with
inner: strandinner: intin two bases.)mthuurne commentedon Nov 19, 2018
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
Outerclass will only useInneraccording to theInnerBaseinterface.