Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overloads, protocols and TypeVar bounds are supported #353

Merged
merged 1 commit into from
Dec 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions docs/typesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,8 @@ Two custom checks are exposed by `pyanalyze.extensions`:

Although pyanalyze aims to support the full Python type system, support for some features is still missing or incomplete, including:

- Overloaded functions
- Bounds, constraints, and variance of TypeVars
- Variance of TypeVars
- `NewType` over non-trivial types
- `Protocol` (PEP 544)
- `ParamSpec` (PEP 612)

More generally, Python is sufficiently dynamic that almost any check like the ones run by pyanalyze will inevitably have false positives: cases where the script sees an error, but the code in fact runs fine. Attributes may be added at runtime in hard-to-detect ways, variables may be created by direct manipulation of the `globals()` dictionary, and the `unittest.mock` module can change anything into anything. Although pyanalyze has a number of configuration mechanisms to deal with these false positives, it is usually better to write code in a way that doesn't require use of these knobs: code that's easier for the script to understand is probably also easier for humans to understand.
Expand Down