3 ms·
ty and zuban also don't give an error. pyright and pyrefly do.
by maleldil 7mo ago
ty and zuban also don't give an error. pyright and pyrefly do.
- _carljm 7mo agoWe provide this diagnostic in ty (https://docs.astral.sh/ty/reference/rules/#possibly-unresolved-reference https://docs.astral.sh/ty/reference/rules/#possibly-unresolv...), but it's disabled by default because it can have false positives in many scenarios where the code works at runtime (this is true also in the type checkers that enable it by default). A typical example is code like def _(flag: bool): if flag: x = True ... if flag: read(x) But it's easy to turn the rule on if you want it: [tool.ty.rules] possibly-unresolved-reference = "error"