Skip to content

TyPy 0.5 documentation

TyPy is an independent implementation of Python that compiles a strict, typed subset of standard Python ahead of time to native executables and C libraries.

Documentation sections

  • What's new in TyPy 0.5: what this release changes, and the changelog of every release.
  • Tutorial: install TyPy, then check, build and run a first program.
  • Library reference: the built-in types, functions and exceptions, and the modules of the standard library TyPy provides.
  • Language reference: what TyPy accepts and what it refuses, one page per area of the language, with the rule ID of each item.
  • Setup and usage: the typy command, its options and the project settings in typy.toml.
  • Extending and embedding: calling C libraries through ctypes, and building a module as a C library.
  • Diagnostics: how TyPy reports a problem, and troubleshooting for every diagnostic code.
  • Engineering documents: the research, requirements, models, architecture, decision records, design, test plan and development guide behind TyPy, with the status of each.

A program TyPy accepts is ordinary Python: it runs under CPython 3.12 and later with the same output and exit status. A program TyPy cannot compile with CPython's meaning is refused with a diagnostic that names the rule it falls outside. Every Python sample in this documentation is checked by the test suite against the current compiler, and an accepted sample is also run under CPython and must print the same output.

Project information