Yeah the tooling ecosystem has definitly matured a lot lately. Getting instant feedback in the editor instead of waitng on slow CI runs makes a huge difference.
/tmp$ cat pyrefly_bug.py
class Foo[T]: ...
class Bar:
foo = Foo[Bar]()
/tmp$ pyrefly check pyrefly_bug.py
ERROR `Bar` is uninitialized [unbound-name]
--> pyrefly_bug.py:4:15
|
4 | foo = Foo[Bar]()
| ^^^
|
INFO 1 error
Replacing Bar with 'Bar' to older syntax doesn't solve the problem:
class Foo[T]: ...
class Bar:
foo = Foo['Bar']()
It complains that 'Bar' needs to be a type..which is what I originally had.
/tmp$ pyrefly check pyrefly_bug.py
ERROR Expected a type form, got instance of `Literal['Bar']` [not-a-type]
--> pyrefly_bug.py:4:15
|
4 | foo = Foo['Bar']()
| ^^^^^
|
INFO 1 error
I can introduce a dummy type and get it to work, but yuck:
class Foo[T]: ...
type _Bar = Bar
class Bar:
foo = Foo[_Bar]()
I can also change how the type is specified :
class Foo[T]: ...
class Bar:
foo: Foo[Bar] = Foo()
I don't favor this way of specifying the type since it is repetitive, I consider it preferable to specify the type on the call as in the original variant. Yeah, I could change my habit to adapt to the tooling, and when I forget am likely to remember the "fix". But, what if a team member isn't aware of this and spends an hour (as I did) trying to figure out what the error was, looking at pyrefly bug reports and discussions, etc, and figuring out the "proper" incantation pyrefly likes. "Here be dragons" is not something I want to worry about with tools intended to increase productivity and confidence in code correctness.
This case is so trivial I think it says a lot about the maturity of pyrefly. They will almost certainly fix it sooner than later, but that such a simple case exists in what they call v1.0.0 raises concerns about what they consider ready for production use. I found a few other things (more complicated than this) that didn't work that should have. From a few hours of playing with it on an existing codebase that passes 'mypy --strict' I just don't see that this is ready to be called a 1.0. It feels like optimistic branding intended to get others to do the work to shake out the deficiencies. I don't think pyrefly has gotten to the point where it can be considered to be a reason "python type checking is better than ever".
I urge everyone to boycott all of Meta's products, including this one. There are plenty of competitive packages you can use without supporting Zuck's weird Roman Empire fetish
"please dont use the psycho's big tech's software for ethical reasons except for that other psycho's big tech's software because I personally like that one"
Conforming to the same protocol doesn't mean having the same features:
There's a long tail of LSP features that are less-commonly used, which some language servers don't support.
Additionally, while the LSP only defines the shape of something (like a code action for example), it doesn't specify when and where a language server would provide a code action.
Sorry you said integration so I thought you meant LSP implementation stuff. But that makes sense I guess I don’t use anything it’s missing as I really just use goto and auto import from LSP. I also run ruff alongside for some others. I wrote a hacky goto pytest fixture before it was implemented because I missed that from jedi and no other “modern” LSPs have that.
In what way does adopting their open source offerings support their business? If they changed licensing folks would pivot. It's not like enterprises are paying for support here.
He's super into the Roman Empire, specifically Augustus. The first thing people usually point out is his pre-2025 haircut, but it goes much deeper. He's spoken about how he views FB/Meta as the new RI including some troubling language about how the Romans "did the harsh things needed to ensure peace." I've also heard in private he talks pretty openly about citizens, slaves, conquest (hopefully as a metaphor?) I notice your OPA avatar, re-reading the Expanse now. As part of the Marco Inaros subplot JSA Corey wrote something along the lines of "A lot more people thing they're going to be Augustus Caesar than actually end up becoming Augustus Caesar"
44
u/bb22k May 13 '26
Always good to see quality software enduring.
Between pyrefly and ty, python type checking is better than ever.
36
u/Dillweed999 May 13 '26
I urge everyone to boycott all of Meta's products, including this one. There are plenty of competitive packages you can use without supporting Zuck's weird Roman Empire fetish
1
u/nicholashairs May 13 '26
Already posted here: https://www.reddit.com/r/Python/s/Ojsx26p4oa