Open EtaoinWu opened 1 month ago
Yup, implementing an AbstractVar
with a property
is an intentional feature.
That said, I don't know of a way to make this static-type-checking compatible. If you think you have a way to do that then I'd be happy to see a PR doing so!
The following code:
runs without a problem, but gives error in pyright and mypy. Pyright complains
and mypy complains
My pylance in vscode somehow only reports the second error ("x" missing) but not the first (property cannot override int).
I believe that
AbstractVar property
is an intentional feature, as the doc saysI suggest this to be fixed by
_ModuleMeta
adding something (to its__new__
?) at typechecking time to modify the__annotations__
of its initializer.