Shelf · Python

Python - Language & Backend

The language the way a backend engineer uses it, from the data model to FastAPI, with the ETL-script habits fixed.

13 chapters · 78 cards · 13 chapters written · #1 in your reading order

Difficulty
Priority
  1. Names refer to objectsEasyP1Know cold
  2. Equality is not identityEasyP1Know cold
  3. Trace mutation through aliasesMediumP1Know cold
  4. Design safe dictionary keysMediumP2Know cold
  5. Separate empty, missing and internedEasyP2Know cold
  6. Choose shallow or deep copyMediumP2Know cold
Difficulty
Priority
  1. Bind and forward function argumentsEasyP1Know cold
  2. Replace shared mutable defaultsEasyP1Know cold
  3. Resolve names with LEGBMediumP1Know cold
  4. Capture state in closures deliberatelyMediumP2Know cold
  5. Pass behavior and bind partialsMediumP2Know cold
  6. Recognize recursion boundariesEasyP4Talk about it
Difficulty
Priority
  1. Separate class and instance stateEasyP1Know cold
  2. Give objects coherent protocolsMediumP2Know cold
  3. Expose properties and constructorsMediumP2Know cold
  4. Prefer composition where substitution failsMediumP2Talk about it
  5. Trace MRO and define ABC contractsHardP3Talk about it
  6. Choose dataclass and slots deliberatelyMediumP3Talk about it
Difficulty
Priority
  1. Iterator protocol, exhaustion and pull modelMediumP2Know cold
  2. Suspend computation with yieldMediumP2Know cold
  3. Choose lazy generator expressionsEasyP2Know cold
  4. Compose streams with itertoolsMediumP3Talk about it
  5. Stream a 20 GB file within a memory budgetMediumP2Know cold
  6. Delegate generators and exchange valuesHardP4Talk about it
Difficulty
Priority
  1. Write decorators that preserve function metadataMediumP2Know cold
  2. Build parameterised decorator factoriesMediumP2Know cold
  3. Apply retry, timing and caching wrappersHardP3Talk about it
  4. Context managers and deterministic cleanupMediumP2Know cold
  5. Express cleanup with contextlibMediumP2Know cold
  6. Preserve errors while resources closeHardP2Know cold
Difficulty
Priority
  1. Catch the intended exception branchMediumP1Know cold
  2. Represent domain failures explicitlyMediumP2Know cold
  3. Trace try, else and finally pathsMediumP1Know cold
  4. Choose EAFP or LBYL at the boundaryMediumP2Know cold
  5. Inspect failures in exception groupsHardP3Talk about it
  6. Log, propagate or recover deliberatelyMediumP2Know cold
Difficulty
Priority
  1. Separate hints from runtime validationEasyP2Know cold
  2. Keep relationships with genericsMediumP3Talk about it
  3. Model capabilities and missing valuesMediumP2Know cold
  4. Pydantic v2 boundary validation and schemasMediumP3Know cold
  5. Use match and walrus without hiding flowMediumP3Talk about it
  6. Read the 3.11 to 3.14 migration mapMediumP5Know it exists
Difficulty
Priority
  1. Runtime concurrency: threads, processes, async and GILHardP3Talk about it
  2. Follow the event loop through awaitMediumP3Know cold
  3. Choose gather or a task groupMediumP3Know cold
  4. Structured async cancellation and TaskGroup ownershipHardP3Talk about it
  5. Isolate blocking work with executorsHardP3Know cold
  6. Explain when async is the wrong answerMediumP3Talk about it
Difficulty
Priority
  1. Explain object retention and collectionMediumP3Talk about it
  2. Locate hot paths with cProfileMediumP2Know cold
  3. Design a useful timeit experimentMediumP3Talk about it
  4. Trace allocation growth with tracemallocMediumP3Talk about it
  5. Fix algorithms before micro-optimisingMediumP2Know cold
  6. Batch work against latency and memory budgetsMediumP2Know cold
Difficulty
Priority
  1. Python package reproducibility: pyproject, environments and resolutionMediumP2Know cold
  2. Choose venv, uv or poetry for a projectEasyP2Know cold
  3. Distinguish modules and packagesEasyP1Know cold
  4. Untangle imports and circular dependenciesMediumP2Know cold
  5. Give a package an explicit entry pointMediumP3Know cold
  6. Rebuild the environment and test the artifactMediumP3Talk about it
Difficulty
Priority
  1. Python test mechanics: pytest fixtures, assertions and lifecycleMediumP2Know cold
  2. Parametrize meaningful boundary casesEasyP2Know cold
  3. Mock the dependency where it is looked upMediumP2Know cold
  4. Control time and interpret coverageMediumP3Know cold
  5. Test an ETL job through failure and replayHardP2Know cold
  6. Introduce property-based testingMediumP4Talk about it
Difficulty
Priority
  1. Build routes around request and response contractsMediumP2Know cold
  2. Inject dependencies and wire authorizationHardP2Know cold
  3. Match async endpoints to actual I/OMediumP3Know cold
  4. Place middleware, errors and background workHardP3Talk about it
  5. ORM boundary: SQLAlchemy 2.x sessions and AlembicHardP3Talk about it
  6. Structure and paginate a maintainable APIMediumP2Know cold
Difficulty
Priority
  1. Choose collections and dict/set idiomsEasyP1Know cold
  2. Work with paths and explicit JSON dataEasyP2Know cold
  3. Make timezones part of the data contractMediumP2Know cold
  4. Review subprocess and regex boundariesMediumP3Talk about it
  5. Configure logging for useful diagnosticsMediumP2Know cold
  6. Run the is-this-Pythonic review checklistMediumP5Know it exists