pytype
pyre-check
pytype | pyre-check | |
---|---|---|
27 | 24 | |
4,991 | 7,085 | |
1.6% | 0.3% | |
8.2 | 10.0 | |
7 days ago | 5 days ago | |
Python | OCaml | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pytype
-
Writing that changed how I think about PL
pytype is based in part upon byterun https://github.com/google/pytype/blob/main/docs/developers/i...
I learnt a lot about bytecode interpreters from working on it, and it helped me understand the cpython source code a lot more easily from having played with a python translation of it first.
-
Astral – "We're building a new static type checker for Python"
There is third, pytype (by google), which I found pretty good but rarely gets mentioned. But, like the others it is slow, so I hope this one is fast and supports all the pytype features (especially being able to type-check un-annotated code).
https://github.com/google/pytype?tab=readme-ov-file#pytype--...
-
Python Meta Circular Interpreter (2019)
pytype (https://github.com/google/pytype) is based on symbolic interpretation of python bytecode, but with the data stack storing types rather than values. it works very well and has been running in production within google forever.
the nice thing about writing a bytecode rather than an AST interpreter is that you can leverage a lot of the work the python compiler does, and work with the resulting simplified code.
-
GIL Become Optional in Python 3.13
There is also the rarely mentioned pytype from Google, written in Python. And pyright from Microsoft is written in Typescript, pyre at Facebook in OCaml. Last time I checked, these had better type inference algorithms (Hindley-Milner?) than mypy.
https://github.com/google/pytype
-
Abstract Interpretation in the Toy Optimizer
my last job was working on [pytype](https://github.com/google/pytype), which uses abstract interpretation to do static type inference and checking for python. we used the cpython compiler to convert a program to bytecode, and then ran the bytecode through a VM where the abstract values were types. it worked extremely well, and could even typecheck completely unannotated code, though of course with less precision than when the user supplied some types.
extending that to runtime JIT compilation is an interesting idea; i'm not sure if any of the current JIT systems do that, but i don't see any reason it wouldn't be a useful technique, so they likely do.
-
Google Mesop: Build web apps in Python
some of them; others are internal tools used at google that the company is happy to let the devs open source, but which are not official google "products". my main project when I was at google was in that category: https://github.com/google/pytype - it was not an "official google product" in that google was not officially supporting it for external users, but it's an extensively used product within google and developing it was my full time job.
-
Google lays off its Python team
it's open source! check out https://github.com/google/pytype and https://github.com/google/pytype/blob/main/docs/developers/t... for more on the multi-file runner
-
Enhance Your Project Quality with These Top Python Libraries
Pytype checks and infers types for your Python code - without requiring type annotations. Pytype can catch type errors in your Python code before you even run it.
-
A Tale of Two Kitchens - Hypermodernizing Your Python Code Base
Pyre from Meta, pyright from Microsoft and PyType from Google provide additional assistance. They can 'infer' types based on code flow and existing types within the code.
-
Mypy 1.6 Released
we've written a little bit about what pytype does differently here: https://google.github.io/pytype/
our main focus is to be able to work with unannotated and partially-annotated code, and treat it on par with fully annotated code.
pyre-check
-
Pylyzer – A fast static code analyzer and language server for Python
Did you come across pyre in your search? MIT license and pretty fast.
https://github.com/facebook/pyre-check
-
Enhance Your Project Quality with These Top Python Libraries
Pyre is a performant type-checker developed by Facebook. Pyre can analyse codebases with millions of lines of code incrementally – providing instantaneous feedback to developers as they write code.
-
A Tale of Two Kitchens - Hypermodernizing Your Python Code Base
Pyre from Meta, pyright from Microsoft and PyType from Google provide additional assistance. They can 'infer' types based on code flow and existing types within the code.
-
Ruff v0.1.0
Have you seen Pyre[0]? Not Rust, OCaml, and pretty fast. Made by a team at Meta and open sourced on GitHub. If you use python-lsp, I wrote an extension[1] to enable integration (though I haven't tested it recently, been programming in rust; it is mostly a "for me" extension).
0: https://pyre-check.org/
1: https://github.com/cricalix/python-lsp-pyre
- Should I Rust or should I Go
- Writing Python like it's Rust
-
Buck2, a large scale build tool written in Rust by Meta, is now available
Internally we use Pyre for Python type checking: https://github.com/facebook/pyre-check
- Are there any sectors that use Haskell as a main programming language?
-
It is becoming difficult for me to be productive in Python
Before type hinting, work had intense rules and linters enforcing docstrings with types. Now, type hints and automatic pyre runs take care of all the heavy lifting.
-
Ruby 3.2’s YJIT is Production-Ready
Python now has an optional type system and if you add one of them such as mypy or pyre to your CI process and you can configure GitHub to refuse the pull request until types are added you can make it somewhat strongly typed.
If you have a preexisting codebase I believe the way you can convert it is to add the types that you know on commits and eventually you will have enough types that adding the missing ones should be easy. For the missing ones Any is a good choice.
https://pyre-check.org and https://github.com/python/mypy are popular.
What are some alternatives?
pyannotate - Auto-generate PEP-484 annotations
typeshed - Collection of library stubs for Python, with static types
mypy - Optional static typing for Python
pyright - Static Type Checker for Python