- Linux "Optional" modules, building and build dependencies
- Versions
- Glossary
- Introduction and Syntax
- Language Features
- Standard Libraries
- Regular Expressions
- Date and Time
- Iterator protcol and
itertools
- File and Network I/O.
- Filesystem and Path Libraries
- Pickle object seralization
- Argument Parsing
- Logging
- Concurrency, subprocesses
- Internet Protocols and Support
- Python Language Services (manipulating Python code)
- Functional Programming
- Functional modules in the standard library
- toolz library (docs)
- Runtime Environments
- Site setup (
sys.path
etc.) - IPython REPL
- Virtual Environments
- Packaging Code
- Microsoft Windows
- Jupyter (IPython) Notebook, Hub, Lab, etc.
- Site setup (
- Testing Libraries
- PythonTestingToolsTaxonomy offers a large list of testing tools.
unittest
doctest
finds and runs tests in function docstrings.- Pytest (Assertions, Configuration)
- tox
- Other Libraries
attrs
to generate class definition boilerplate- PyYAML
- PyMongo
- Twisted, an event-driven networking/concurrency framework
- Git Libraries
- SQLAlchemy
- Tips and Tricks
When using pip
with a system (OS-packaged) Python, ensure that the
python-dev
or python3-dev
(Debian) package is installed or some
packages may not build. (The typical error message will include
something about not being able to find <Python.h>
.)
- dunder: Double underline, as in
__name__
.
See also python-version-cheat-sheet and offical changelog.
- 3.3:
yield from
(PEP380) - 3.4:
pathlib
(PEP 428) - 3.5: Additional unpacking generalisations (PEP 448). Type annotations excepting variables (PEP 484).
- 3.6: f-strings (PEP 498, for ≥3.12 PEP 701). Underscores in numeric literals, e.g. 1_000 (PEP 515). Type annotations for variables (PEP 526).
- 3.7: Guaranteed sort order of dicts.
Data classes (PEP 557).
breakpoint()
(PEP 553). Postponed eval of annotations (PEP 563). - 3.8: Walrus operator
:=
(PEP 572) - 3.9: Built-in generic types; annotate w/
list[int]
instead offrom typing import List
(PEP 585). - 3.10: Structural pattern matchin (PEP 622).
Union types as
X | Y
(PEP 604). - 3.11: Exception groups,
except*
(PEP 654). Standard librarytomlib
for parsing TOML (PEP 680).