Skip to content

Conversation

@danudey
Copy link
Contributor

@danudey danudey commented Oct 17, 2025

Pyrefly is a new, incredibly fast, type checker written in Rust by Meta. This PR adds pyrefly as a check, and also fixes all the existing issues it finds.

A few notes:

  • There are a few cases where, for the sake of brevity, we explicitly create new types to satisfy the type checker rather than e.g. scattering int(foo) everywhere it's used. This also has the side effect of making it clear which type you're expecting based on which parameter you're using.
  • For the windows VCP module, type checking is obviously broken on my local since I'm not testing on Windows. I've yet to determine how to conditionally type check a file (i.e. to not do type checks on vcp_windows.py if we're not on Windows), so for the few accesses which do not eist on Windows I moved those to separate centralized 'aliases' so I could add pyrefly:ignore to those specific lines rather than scattering them all over the codebase. Not sure if this is the right call, willing to change this up if it feels yucky.

@newAM
Copy link
Owner

newAM commented Oct 25, 2025

Thanks for all the fixes! Can you resolve the conflict?

I think there may also be some syntaxes that need to be changed for older python versions, I try to maintain support for all versions still getting official security updates. Feel free to ignore 3.9 though, support for that version ends this month.

@danudey
Copy link
Contributor Author

danudey commented Oct 25, 2025

Sounds good, I'll switch over to testing with 3.10 then and see if anything needs fixing then update the branch again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants