pyre-check
typing
pyre-check | typing | |
---|---|---|
24 | 38 | |
6,718 | 1,553 | |
0.4% | 0.5% | |
9.9 | 9.2 | |
1 day ago | 8 days ago | |
OCaml | Python | |
MIT License | GNU General Public License v3.0 or later |
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.
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.
typing
- Writing Python like it’s Rust
- Library for single dispatch on Generic subscript
-
Thoughts on nested / inner functions in Python for better encapsulation and clarity?
Iterable[str] is unfortunately evil as it matches str which is often unintended. (see: https://github.com/python/typing/issues/256) One would need both NOT-type and AND-type in order to properly handle these.
-
How to be more Literal in Python
The basic motivation behind them is that functions can have arguments that can only take a specific set of values, and those functions return values/types change based on that input. Common examples are (you can find more here):
-
Python 3.11.0b1 is out! Python 3.11 is now in feature freeze mode!
While yes 26 people liked the idea here: https://github.com/python/typing/issues/193
-
Type Hinting - Constrain metaclass of typing.Type
but looking at relevant issues on GitHub it seems this has been shot down repeatedly. python/typing#18, python/typing#213
-
What type hint should I use for "some container type" in general but explicitly exclude the str type?
See https://github.com/python/typing/issues/256 for a discussion.
-
Type annotations: how to express list contravariance?
Lower bounds are not supported for TypeVars, unfortunately.
-
I use attrs instead of pydantic
Mypy allows that because initial versions of PEP-484 allowed that. This has changed; here's the current wording on the PEP:
> This is no longer the recommended behavior. Type checkers should move towards requiring the optional type to be made explicit.
https://www.python.org/dev/peps/pep-0484/#id29
-
Can I walk through the entire hierarchy of object types?
Dunno, other, larger projects than the one I'm working on seem to run up against this from time to time. (rasa_core, to pick one example from near the top of a Google search; also Telethon, Blender, TensorFlow, Pandas. Guido also filed a bug on the typing module in an early version of Python 3.5 because of unexpected implications of this particular issue, so the problem isn't exactly purely theoretical.) That's aside from the wish for conceptual purity in the call signatures of classes and their subclasses, which is not always and automatically a bad wish to have; and the notion that a language that prides itself on its introspective faculties might want to make introspection of classes from the top of a class hierarchy possible, at least in theory? Perhaps to facility learning about the language and/or visualizing large class hierarchies easily, for instance?
What are some alternatives?
pyright - Static Type Checker for Python
mypy - Optional static typing for Python
fp-ts - Functional programming in TypeScript
pytype - A static type analyzer for Python code
pydantic - Data validation using Python type hints
typeshed - Collection of library stubs for Python, with static types
Telethon - Pure Python 3 MTProto API Telegram client library, for bots too!
flake8
mashumaro - Fast and well tested serialization library
mamba - The Fast Cross-Platform Package Manager
intellij-community - IntelliJ IDEA Community Edition & IntelliJ Platform