Search across all documentation pages
12 pages in this section.
What actually happens when Python runs a line of code - names, objects, namespaces, and scope - and why that single model explains variables, functions, and imports at once.
A one-page intro tour with runnable snippets covering the essentials before deeper sections.
How names, objects, and reference semantics actually work in CPython.
int/float/`Decimal`/`Fraction`, operators, and floating-point gotchas.
Formatting, methods, Unicode, `bytes` vs `str`, and the f-string mini-language.
`if`/`match` (structural pattern matching), loops, `else`/`for`, and short-circuiting.
List/dict/set comprehensions and when to prefer a generator.
Positional/keyword/`*args`/`**kwargs`, defaults, `nonlocal`/`global`, and LEGB scope.
Import system, `__init__.py`, namespace packages, and avoiding circular imports.
Reading/writing text and binary, `pathlib`, encodings, and context managers.
Creating and using an isolated environment before you write real code.
The core habits every Python developer should internalize first.