Skip to content

Alternative type checker support #8

@abelcheung

Description

@abelcheung

Todo

Evaluation of type checker situations

Ty

Very new but fast and promising, though not ready for production use yet. Currently added support but disabled explicitly during runtime tests.

Vendor Astral
OS Windows, Macos, Linux
Written in Rust
Can validate .pyi Yes

Pyrefly (implementation complete)

Successor of Pyre, fast like all other Rust-based type checkers. Needs a bunch of type-ignore comments, but otherwise almost ready for production use.

Vendor Meta
OS Windows, Macos, Linux
Written in Rust
Can validate .pyi Yes

Zuban (plan shelved for now)

Vendor Jedi author
OS Windows, Macos, Linux
Written in Rust
Can validate .pyi Yes

Pyre-check (target Pyrefly instead)

The support for PEP561 is new, so the current situation is still not fully evaluated. However some problems are immediately notable:

  • Don't understand re-exported symbols (need to import directly from the file it is defined)
  • Thinks logging.LoggerAdapter is a non-generic class
  • Fail to import external cssselect annotation
Vendor Facebook
OS MacOS, Linux
PEP561 support Yes (according to facebook/pyre-check#70 )
Can validate .pyi Unknown

PyType (plan shelved for now)

Although not officially supported, typeshed has already been successfully using PyType in test suite by importing pytype.io.parse_pyi.

Vendor Google
OS MacOS, Linux
Can validate .pyi Hidden (via API)

PyCharm (plan shelved for now)

Unfortunately the situation is unsatisfactory despite having PEP561 support. There are multiple unfixed issues involving underscored attributes and methods:

Underscored class names like _Element, _ElementTree are building blocks of lxml, which can't be lived without. Annotation of many function arguments become impossible without using them. But the degree of inconvenience introduced by bugs above seriously hinder UX of developers using lxml. It even induced well-intended yet unnecessary PR on types-lxml.

For now, putting to extreme, PyCharm should be avoided like plague until relevant bugs are fixed.

Vendor JetBrains
OS Windows, MacOS, Linux
PEP561 support Yes

Sub-issues

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions