-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot inference common base class when root of hierarchy is Any
#5134
Comments
Note that this also passes (why I believe to be ~related to diff --git a/t2.py b/t2.py
index 91a8309..1e9896b 100644
--- a/t2.py
+++ b/t2.py
@@ -3,7 +3,7 @@ from typing import Type
from external import ExtBase
-class Base(ExtBase):
+class Base:
pass
|
This looks like another case where the conditional expression should take the context into account. I wonder if it works as expected when #5095 is reverted? |
Seems to work as expected when reverting that, yes:
|
OK, then the fix would entail improving on that diff (it partially reverted #5041, which would have the desired effect here but not in general). Perhaps we should always try the make_simplified_union() call and accept the return value if it's not a Union -- that seems to be the case here. |
TBH, I would also allow
The point is that |
I fixed this in #14404 |
I believe this to be a bug
code
(this has been boiled down from a more complete example)
output
output with types revealed
version information
against master
same error
peculiarly working
The text was updated successfully, but these errors were encountered: