Reference
This pillar is the language reference. It describes the Python that gopy implements, top to bottom, with no narrative. If you want to know exactly what a token, expression, statement, builtin, or bytecode does, this is the place to look. The text is held against CPython 3.14 and divergence is a parity bug.
Sections
Language
| Page | Covers |
|---|---|
| Lexical analysis | Source encoding, line structure, identifiers, keywords, literals, operators. |
| Grammar | The full PEG grammar, terminals, and soft keywords. |
| Data model | Objects, values, types, the standard type hierarchy. |
| Special methods | Every __dunder__ slot, its signature, and when the VM calls it. |
| Execution model | Naming, binding, scopes, exception propagation. |
| Import system | Packages, search path, finders, loaders, namespace packages. |
| Expressions | Atoms, primaries, operators, precedence, comprehensions, f-strings. |
| Simple statements | Assignment, del, return, yield, raise, import, type, ... |
| Compound statements | if, while, for, try, with, match, def, class, async. |
| Top-level components | Modules, interactive sessions, expression input. |
Built-ins
| Page | Covers |
|---|---|
| Built-in types | Every type in the standard hierarchy, all methods. |
| Built-in functions | abs, len, print, etc.; constants; classes. |
| Built-in exceptions | The full exception hierarchy with rationale. |
Bytecode
| Page | Covers |
|---|---|
| Opcodes | Every Tier-1 opcode with stack effect and oparg. |
How to read these pages
- Page layout. A short introductory paragraph, then dense tables. Tables index a feature by name and point to the source-of-record in CPython 3.14.
- Source citations.
Parser/lexer/lexer.c:1234funcname style. Look those up in the CPython mirror. - Gopy status. Where gopy's implementation diverges or is partial, the diverging row is called out. See Manual -> Status for the subsystem-level picture.
Conventions
- Bytecode names match CPython exactly. Where this page lists
LOAD_FAST_BORROW, the same byte appears in gopy's compiled output. - Dunder names are written
__name__. Slot names use CPython'stp_/nb_/sq_/mp_/am_prefixes. - "Implementation defined" means the language spec gives latitude. Where gopy and CPython differ in implementation-defined behaviour, gopy still matches CPython byte-for-byte unless explicitly noted.
What is not in this pillar
- How the implementation works. That lives under CPython internals and gopy internals.
- Per-module API. Module-by-module references live under Modules.
- Worked examples and recipes. Those live under Manual -> Recipes.