Pylance didn't honor return type from __new__
in special cases
#5057
Labels
needs repro
Issue has not been reproduced yet
__new__
in special cases
#5057
Environment data
Code Snippet
Expected behavior
a1
anda2
are both stringstub
, anda1
anda2
should both be typed as(variable) a2: str
Actual behavior
a1
is typed astyping: (variable) a1: TestClass
a2
is typed as(variable) a2: str
According to #1092 ,
pyright
checks return type from__new__
sinceversion 2021.3.4
, so I guess it might be a pylance issue.The text was updated successfully, but these errors were encountered: