Notes from Jaimie Murdock:
Assumes a start with Python 3.6. Python 2.7 is end of life in 2020, so new projects should avoid it.
PEPs (Python Enhancement Proposals) are how new features are added to the language and are very useful for learning why things are the way they are.
Some also offer style guidance.
len()
of the list. This improves memory usage.f
-strings, requires Python 3.6collections
– especially defaultdict
, which helps avoid KeyError
issues when populating a collectionpickle
– Python-native serialization. For export, better practice to use JSON via json.dump(obj)
, but useful when in-memory objects take a long time to build.re
unittest
unittest.mock
– super useful for injecting fake-responses from HTTP servers for testingcoverage.py
– pip install coverage