r/programming • • 13d ago

Pyrefly 1.5: 100% Conformance and 40% Faster

https://github.com/pyrefly-org/pyrefly/releases/tag/1.5.0

Link to release: https://github.com/pyrefly-org/pyrefly/releases/tag/1.5.0

Pyrefly (a Python type checker and language server) has just release version 1.5. It brings large performance optimizations and new features like Tensor Types six months after the first stable release.

Highlights (Taken from release):

  • 100% typing spec conformance. Pyrefly now passes all 146 test files in the typing conformance suite. Some of these fixes change how names in annotations resolve; see Behavior Changes.
  • Faster checks. v1.5.0 checks 40% faster than v1.4.1 and uses 9% less memory across the 71 benchmarks in Astral's ty_benchmark and the python-type-checking benchmark suites. (Tested on an M5 Max MacBook Pro with 18 threads.)
  • A new hint severity. Diagnostics that were previously IDE-only are now regular error kinds at a new hint severity: unused-import, unused-parameter, unused-variable, unreachable, and inactive-code (formerly unreachable-code). By default, they appear in your editor and are hidden from pyrefly check output, but you can configure them in pyrefly.toml, silence them with suppression comments, or promote them to errors like any other error kind.
95 Upvotes

14 comments sorted by

18

u/tristan957 13d ago

How does this compare to Ty for people?

32

u/pyrefly_kyle 13d ago edited 13d ago

ty is also a great type checker! We should have more blogs up shortly as this one is now out of date.
In my experience:

- our tool is very mature (theirs is not yet stable, ours has been >1.0 for >6 months) and adopted in large codebases like google, instagram, etc

- our tool has 100% typing conformance

- I'm most excited about our features like tensor types which put dimensionality into python containers. really cool if you do numerical computing or machine learning

19

u/Zizizizz 13d ago

This one is better in my experience, it's got stable releases and is less noisy in my experience 

9

u/teerre 12d ago

This is maybe a month or so old, but Ty had problems with even basic stuff like. list[T]. Pyrefly actually works

4

u/RedEyed__ 11d ago

IDK, pyrefly works in production fine. We tried ty, and it is very alpha.

13

u/GameCounter 12d ago

I have a pretty big legacy Django codebase (roughly 200k lines of code).

We had a bakeoff and I ended picking pyrefly as our typechecker for CI, which has worked better than I anticipated.

I've opened about 3 issues and literally all of them were picked up and resolved in a matter of days, which really impressed me.

2

u/samg 10d ago edited 10d ago

Thank you for taking the time to report issues! 

1

u/M4mb0 7d ago

Great achievement, and the best type checker imo.

Hope for full python 3.15 support in the next release!

1

u/pyrefly_kyle 7d ago

thanks! any features in particular you're missing out on? I'll start fixing our issues tagged 3.15 here today and do another 3.15 audit but if you find any more please let us know

1

u/[deleted] 9d ago

[removed] — view removed comment

1

u/pyrefly_kyle 9d ago

full-project checks! see the blog post for more details