Open-source project
google/pytype avatar
google/pytype

Pytype: A Bytecode-Based Python Type Analyzer Facing a Python 3.12 Sunset

GitHub describes it as A static type analyzer for Python code. The repository metadata lists Python as its primary language. The metadata lists the NOASSERTION license. This article stays within the project description and details documented in the GitHub repository README.

5,035 stars289 forksPythonNOASSERTION

At a glance

What is it?
Google's pytype is a mature static type analyzer for Python, but its development is winding down. The README announces that Python 3.12 will be the last supported version, pushing users toward other typing tools.
Who is it for?
Adopt pytype only if you are on Python 3.12 or earlier and need a type checker that infers annotations from untyped code. Do not start a new project on Python 3.13+ with pytype, as it will not support that version.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
No. The owners have archived the repository on GitHub, so it is read-only and no longer receives changes.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • google/pytype5,035 ★ · +6
Star history
Repository2026-08-132026-11-15
google/pytype5k5k

6 Stars in the last 94 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What Pytype Does and Who It Serves

Pytype is a static type analyzer for Python. It was built to give developers compile-time checking, a concept that predates the widespread adoption of inline type annotations. The README explains that pytype began in 2012 to meet Google developers' demand for compile-time checking. Its original approach was type inference plus interface files, later switching to inline annotations after PEP 484 was accepted. The tool is for engineers who want to catch type errors before runtime, especially in codebases that lack annotations. Pytype can infer types from untyped code, which makes it useful for legacy projects. But the repository is now archived, so its target audience is shrinking.

The Bytecode-Based Engine and Its Consequences

Pytype's core mechanism is bytecode analysis. The README states that pytype is 'bytecode-based,' meaning it inspects the compiled bytecode of Python functions rather than just the source AST. This design was effective for many years, but it also created challenges. The README cites 'bytecode's inherent instability and propensity to change' as a reason for the project's slowdown. Each new Python version can alter bytecode instructions, requiring pytype to update its internal mappings. This makes adopting new typing PEPs slower, because the bytecode layer must be adjusted first. The trade-off is clear: a bytecode engine can handle untyped code robustly, but it ties the tool's lifespan to Python's internal representation.

Getting Pytype Running

The README does not include installation or usage commands; the repository is a Python package with a setup.py and a pyproject.toml. The README mentions interface files, which are a pytype-specific output format. The documentation on the project's homepage (google.github.io/pytype) would give exact flags and config options, but the README itself does not list any.

The Python 3.12 Sunset and Its Implications

The most important fact in the README is the support policy: 'The last supported Python version for Pytype will be 3.12.' This is a hard boundary. If you are on Python 3.13 or later, pytype does not support it. The README says the team is 'shifting our investments towards new ideas and different frameworks,' which is a polite way of saying the project is winding down. The repository is now archived and has no GitHub releases. For a type checker, this is a critical limitation: Python evolves, and a checker that cannot track new syntax and bytecode becomes a liability. Any team using pytype must plan a migration path before upgrading Python.

Alternatives and the Ecosystem Shift

The README explicitly encourages users to 'investigate the mature and excellent alternative solutions for Python typing.' It points to a FAQ link for details. The most obvious alternative is mypy, which is mentioned in the README as a collaborator in creating typeshed. Other tools like Pyright and pyre also exist, but the README does not name them. The key difference is architectural: pytype's bytecode engine handles untyped code via inference, while mypy typically requires annotations or uses stub files. If you have a codebase with no annotations, pytype's inference is a strong draw. But if you are starting fresh, the README's advice is to investigate the mature alternative solutions linked from its FAQ.

Maintenance and License Considerations

The README does not state a license, and the repository metadata says 'NOASSERTION,' but the repository includes a LICENSE file at the top level, so read that file for the actual terms. The README also implies a maintenance cost: the team is not investing in new features, so you should expect fewer bug fixes and no support for Python versions after 3.12. The project has a long history, with four main contributors mentioned, but the future is uncertain. If you rely on pytype, you must budget time for migrating to another tool eventually. The README's tone is gracious but final. The repository is archived, and the project is on a clear path to obsolescence.

Editorial conclusion

Adopt pytype only if you are on Python 3.12 or earlier and need a type checker that infers annotations from untyped code. Do not start a new project on Python 3.13+ with pytype, as it will not support that version. Before committing, verify that your Python version is 3.12 or earlier, and check the linked FAQ in the README for the maintainers' list of recommended alternatives. If you need long-term support for future Python versions, choose mypy or another actively maintained checker.

Frequently asked questions

How does pytype compare with pyright?

Nothing in this repository compares the two. What is on record is pytype's own shape: a bytecode based design, which the announcement names as the reason new typing features arrived slowly, a repository that is archived, and Python 3.12 as the last supported version. It also invites readers to investigate mature alternatives in the Python typing ecosystem, with a discussion in issue 1925.

Does pytype work with vscode?

The repository text says nothing about editors. What exists is a static type analyzer for Python code with a bytecode based design, a C++ typegraph extension built through pybind11 at C++ standard 20, and a self check configuration in pyproject.toml that points the analyzer at pytype and pytype_extensions.

What are the alternatives to pytype now?

The announcement makes Python 3.12 the last supported version, says investment is moving towards new ideas and different frameworks, and asks readers to investigate mature solutions for Python typing going forward, linking an FAQ at github.com/google/pytype/issues/1925. It also names typeshed, created with Guido and mypy, as a central repository for type annotations.

What is mypy's relationship to pytype?

pytype's team collaborated with Guido and mypy to create typeshed, a central repository for type annotations. The repository also carries typeshed handling of its own, with a top level typeshed entry, a pytype/typeshed path inside the package, and a copy_typeshed function in setup.py that works around a symlink which does not hold on Windows.

How does type() relate to pytype?

They are different things. The Python builtin type() appears nowhere in this repository. pytype is a static type analyzer for Python code, and the name refers to that tool: it kept its inference engine when the project moved from interface files to inline annotations, and it works on compiled bytecode rather than on the builtin.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/google-pytype.svg)](https://hysenlabs.com/projects/google-pytype)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/google-pytype.svg)](https://hysenlabs.com/projects/google-pytype)

Was this useful?