class variable of subclass of Unknown type #10877
|
I looked at #10847 and noticed different type inference results between class variables and other variables when a base class of variable type is in extension module. from cython_code_without_stub import B
class A(B):
pass
class T:
cls_var = A()
reveal_type(cls_var)
def f(self):
reveal_type(T.cls_var)
self.inst_var = A()
reveal_type(self.inst_var)
var = A()
reveal_type(var) |
Answered by
Azureblade3808
Sep 2, 2025
Replies: 1 comment 1 reply
|
Type of |
1 reply
Answer selected by
pinterior
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Type of
BisUnknown.->
Bcould be a descriptor class.->
Acould be a descriptor class.-> Type of
T.cls_var(and alsoself.cls_var) isUnknown.