Python Reference
Python Reference Materials
Try to migrate the key component of these reference materials into this document. Links will inevitably become unavailable and the document should preserve the information. Most information here will likely be from a derivative source anyways, so some long term effort could be made to resubstantiate each section with a primary reference in the Python reference, library, PEPs, source code, etc.
Sections
Quick HTTP Server
python -m http.server
Python Operator Precedence
Helpful and
and or
Idioms
-
Set a default value with
or
python `def thing(foo, *, opt=None): opt = opt or {}`
-
Avoid a zero division error with
and
when adding if statementspython b = 0 a = (b and 100 / b) a