by nas · 8mo ago · 0 comments
For "normal" Python code, I find mypy does pretty good. Certainly I find it helpful, especially on a large code base and when working with other developers of various experience levels.
The reason I prefer pyrefly over mypy is mostly because of speed. Better accuracy is nice but speed it the killer feature. Given the quality of uv and ruff and the experience of the team working on ty, I'm quite confident it's going to be great in that respect as well.
Yeah, that would be the wrong takeaway from this blog. The point of the blog was to add context to what the conformance results mean and clarify their limitations, since I saw quite a few people sharing links to the tracker online w/o context.
Example
def foo(bar: bool) -> bool:
if bar:
m = True
return m
No error that m is defined conditionally? What's going on? 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"