Library reference¶
TyPy provides Python's built-in types, functions and exceptions, and the modules of the standard library listed below, each with CPython's names, results and errors. It adds no module of its own. Where a function behaves as CPython's does, the Python Standard Library documents it.
| Page | Area | Rules |
|---|---|---|
| Built-in types | int, float, str, bytes, lists, tuples, dicts and sets |
DAT |
| Exceptions | Raising, catching and with, and the built-in exception classes |
EXC |
| Built-in functions and modules | Builtins, methods of the built-in types, % formatting, math, sys and files |
LIB |
TyPy 0.5 provides these modules of the standard library:
| Module | What TyPy provides | Described in |
|---|---|---|
math |
Its constants and its functions of numbers | Built-in functions and modules |
sys |
argv, exit, the standard streams, the version and the recursion limit |
Built-in functions and modules |
dataclasses |
dataclass and field |
Classes |
typing, collections.abc and types |
Names for annotations, such as Iterator, Final and Protocol |
Modules |
ctypes |
Calls into C libraries, with C objects, pointers, arrays and structures | C interoperability |
A module planned for a later release, such as os, time or random, is
refused with E0201.