Final Review: Dari 20 Jam Pertama ke Top-Tier Python Engineering Judgment
Part 035 — Final Review: Dari 20 Jam Pertama ke Top-Tier Python Engineering Judgment
Final review seri belajar Python berbasis The First 20 Hours: menyatukan mental model, skill tree, deliberate practice, engineering judgment, rubric top-tier, capstone review, dan rencana lanjutan setelah 20 jam pertama.
Part 035 — Final Review: Dari 20 Jam Pertama ke Top-Tier Python Engineering Judgment
1. Tujuan Part Ini
Ini adalah bagian terakhir dari seri Python.
Seri ini dimulai dengan framework The First 20 Hours: belajar cepat bukan berarti belajar dangkal, tetapi:
- menentukan target performa;
- mendekonstruksi skill;
- menghapus hambatan;
- belajar cukup untuk self-correction;
- praktik intens dengan feedback loop.
Kita lalu memperluas Python dari sekadar syntax menjadi engineering platform:
- language;
- runtime;
- object model;
- standard library;
- testing ecosystem;
- packaging;
- typing;
- concurrency;
- async;
- performance;
- memory;
- CPython internals;
- API;
- persistence;
- architecture;
- security;
- observability;
- modernization;
- capstone production service.
Part final ini menyatukan semuanya menjadi satu tujuan:
Bukan hanya “bisa Python”, tetapi punya judgment Python engineering yang matang.
Target setelah part ini:
- Mengingat big picture seluruh seri.
- Mengetahui skill apa yang sudah dikuasai.
- Mengetahui skill apa yang harus dilatih berikutnya.
- Memiliki self-assessment rubric.
- Memiliki checklist top-tier Python engineer.
- Memahami cara menilai desain Python.
- Memiliki plan lanjutan setelah 20 jam pertama.
- Bisa mereview capstone dengan objektif.
- Bisa menghadapi interview/system design Python.
- Bisa terus meningkatkan kemampuan tanpa tersesat di tutorial.
2. Big Picture Seri Ini
Skill Python bukan linear murni. Ia berbentuk jaringan.
Syntax membantu membaca kode. Object model membantu memahami mutability. Testing membantu desain. Typing membantu contract. Packaging membantu reproducibility. Architecture membantu maintainability. Observability membantu production. Security membantu trust. Performance membantu scale. Modernization membantu umur panjang.
Top-tier Python engineer menghubungkan semua ini.
3. The First 20 Hours: Review
Framework Kaufman yang kita pakai:
3.1 Deconstruct the Skill
Python dipecah menjadi sub-skill:
- syntax survival;
- environment/tooling;
- object model;
- collections;
- functions;
- modules/imports;
- exceptions;
- iteration;
- OOP/dataclass/protocol;
- typing;
- testing;
- packaging;
- I/O;
- logging;
- concurrency;
- async;
- performance;
- memory;
- API;
- data access;
- architecture;
- security;
- observability;
- modernization.
3.2 Learn Enough to Self-Correct
Kamu tidak harus menghafal semua dokumentasi Python. Tetapi kamu harus cukup paham untuk:
- membaca traceback;
- mencari dokumentasi resmi;
- membuat minimal reproduction;
- menulis test;
- menjalankan profiler;
- memahami error;
- membedakan bug domain vs bug boundary;
- tahu kapan perlu dependency eksternal;
- tahu kapan desain terlalu kompleks.
3.3 Remove Practice Barriers
Hambatan yang harus dihapus:
- environment rusak;
- command tidak standar;
- dependency tidak jelas;
- test lambat/tidak ada;
- editor salah interpreter;
- tidak ada project structure;
- tidak ada quality gate;
- tidak tahu cara menjalankan kode;
- tidak tahu cara mengukur.
3.4 Practice Deliberately
Bukan hanya membaca.
Latihan inti seri ini:
- bangun
case-tracker; - refactor bertahap;
- tulis tests;
- buat CLI;
- tambah repository;
- tambah API;
- tambah storage;
- tambah logging;
- profiling;
- capstone.
3.5 Feedback Loop
Feedback cepat adalah akselerator belajar.
4. What “Top-Tier Python Engineer” Means
Top-tier bukan berarti tahu setiap library.
Top-tier berarti:
- Bisa membuat desain sederhana yang benar.
- Bisa menjelaskan trade-off.
- Bisa membaca failure.
- Bisa menulis test yang memberi confidence.
- Bisa membuat boundary yang jelas.
- Bisa menjaga domain dari framework leakage.
- Bisa memilih dependency dengan sadar.
- Bisa mengukur performa sebelum optimisasi.
- Bisa membuat sistem observable.
- Bisa memodernisasi legacy code tanpa merusak produksi.
- Bisa mengajari engineer lain melalui code clarity.
- Bisa membuat keputusan sesuai context.
Top-tier engineer bukan “template collector”. Mereka punya mental model.
5. Mental Models yang Harus Tertanam
5.1 Python Program adalah Object Graph
case = Case(...)
cases = [case]
List menyimpan reference ke object. Mutation dan aliasing penting.
5.2 Variable adalah Name Binding, Bukan Box
a = []
b = a
a dan b menunjuk object sama.
5.3 Mutability adalah Design Decision
Mutable object memudahkan update, tetapi membuka aliasing/race bug.
Immutability/value object memperkuat invariant.
5.4 Function adalah Boundary
Function signature adalah contract.
def transition_case(case_id: CaseId, *, target_status: CaseStatus) -> Case:
...
5.5 Module adalah Architectural Unit
Import direction mencerminkan dependency direction.
5.6 Exception adalah Failure Semantics
Exception bukan hanya error. Ia menyatakan jenis failure dan boundary penanganannya.
5.7 Tests adalah Design Feedback
Jika test sulit ditulis, desain mungkin terlalu coupled.
5.8 Type Hints adalah Static Reasoning
Type hints bukan runtime enforcement default, tetapi meningkatkan contract dan refactor safety.
5.9 Packaging adalah Reliability Boundary
Project harus bisa diinstall, dibuild, dan direproduksi.
5.10 Standard Library First
Dependency eksternal harus memberi leverage lebih besar dari cost.
5.11 Logging adalah Runtime Narrative
Logs membantu menjawab “apa yang terjadi?”
5.12 Concurrency Dipilih Berdasarkan Workload
Thread, process, async bukan gaya. Mereka alat untuk bottleneck berbeda.
5.13 Performance Harus Diukur
Tanpa baseline, optimisasi hanyalah tebakan.
5.14 Domain Tidak Boleh Bocor Framework
FastAPI/Pydantic/SQLAlchemy adalah boundary/infrastructure, bukan domain core.
5.15 Production Readiness adalah Operability
Kode harus bisa dijalankan, diamati, didiagnosis, dan dipulihkan.
6. The Python Engineering Stack
Setiap layer punya failure mode.
Contoh:
- Language: mutability bug.
- Runtime: memory leak due retained references.
- Standard library: encoding bug.
- Tooling: CI mismatch.
- Testing: over-mocking.
- Typing:
Anyleakage. - Packaging: missing runtime dependency.
- Architecture: circular dependency.
- Persistence: transaction bug.
- Security: object-level authorization missing.
- Observability: no request id.
- Operations: no readiness check.
- Modernization: breaking change without deprecation.
7. Review Seluruh 35 Part
Part 001 — Target Performance, Scope, dan Learning Contract
Kamu menentukan tujuan belajar dan kontrak 20 jam.
Key insight:
Belajar cepat butuh scope yang tajam.
Part 002 — Deconstructing Python
Python dilihat sebagai bahasa, runtime, object system, ecosystem, dan platform.
Key insight:
Python bukan satu hal; Python adalah stack.
Part 003 — Environment dan Toolchain
Kamu membangun environment reproducible.
Key insight:
Friction membunuh deliberate practice.
Part 004 — Syntax Survival
Kamu memahami syntax dasar untuk membaca/menulis program.
Key insight:
Syntax adalah entry point, bukan tujuan akhir.
Part 005 — Mini Project Pertama
Kamu mulai case-tracker.
Key insight:
Project kecil dengan feedback loop lebih baik daripada teori tanpa praktik.
Part 006 — Data Model
Object, identity, equality, mutability.
Key insight:
Banyak bug Python adalah bug reference dan mutability.
Part 007 — Collections
List, tuple, dict, set, complexity, modelling.
Key insight:
Pilihan collection adalah pilihan desain.
Part 008 — Functions
Function sebagai unit desain.
Key insight:
Signature yang baik mengurangi kompleksitas caller.
Part 009 — Modules dan Imports
Boundary, import graph, side effects.
Key insight:
Import direction adalah architecture signal.
Part 010 — Exceptions
Failure semantics dan defensive Python.
Key insight:
Error handling adalah desain contract, bukan afterthought.
Part 011 — Iteration dan Generators
Lazy thinking, iterables, pipelines.
Key insight:
Tidak semua data harus dimaterialisasi.
Part 012 — OOP, Dataclass, Protocol
Composition, Protocol, domain model.
Key insight:
Python OOP kuat jika dipakai untuk behavior dan boundary, bukan ceremony.
Part 013 — Type Hints
Gradual typing, TypedDict, Protocol, generics.
Key insight:
Type hints membantu berpikir statis di bahasa dinamis.
Part 014 — pytest
Testing sebagai design feedback.
Key insight:
Test yang baik membuat desain lebih jelas.
Part 015 — Test Architecture
Fakes, mocks, contract tests, property tests.
Key insight:
Test suite harus mendukung refactor, bukan mengunci implementasi.
Part 016 — Code Quality Tooling
Ruff, type checker, CI, quality gate.
Key insight:
Tooling menghilangkan noise agar review fokus ke judgment.
Part 017 — Packaging
pyproject, dependencies, build, reproducibility.
Key insight:
Code yang tidak bisa diinstall dengan benar belum siap jadi software.
Part 018 — Standard Library
Leverage dari modul bawaan.
Key insight:
Standard library mengurangi dependency risk dan memperkuat pemahaman problem.
Part 019 — File I/O and Serialization
Data boundary, atomic write, schema evolution.
Key insight:
Data eksternal harus divalidasi sebelum masuk domain.
Part 020 — Logging and Diagnostics
Runtime visibility.
Key insight:
Sistem yang tidak bisa didiagnosis akan mahal dioperasikan.
Part 021 — Concurrency
Threads, processes, GIL, workload classification.
Key insight:
Concurrency adalah desain bottleneck, bukan default speedup.
Part 022 — Async
Event loop, tasks, cancellation, backpressure.
Key insight:
Async cocok untuk I/O concurrency, bukan solusi universal.
Part 023 — Performance
Measurement before optimization.
Key insight:
Optimize only after measuring.
Part 024 — Memory
Object overhead, tracemalloc, slots, streaming.
Key insight:
Memory bottleneck sering berasal dari representation dan allocation.
Part 025 — CPython Internals
Bytecode, refcount, GC, GIL.
Key insight:
Internals memberi insight, bukan alasan menulis kode fragile.
Part 026 — API Development
FastAPI, Pydantic, service boundary.
Key insight:
API route harus tipis; domain harus framework-agnostic.
Part 027 — Data Access
SQLAlchemy, transactions, repository, UoW.
Key insight:
Persistence harus punya transaction boundary yang jelas.
Part 028 — Architecture
Layering, ports/adapters, domain modelling.
Key insight:
Architecture adalah dependency management untuk perubahan jangka panjang.
Part 029 — State Machines
Workflow, guards, audit, idempotency.
Key insight:
Complex lifecycle harus dimodelkan eksplisit.
Part 030 — Security
Threat modelling, authorization, injection, secrets.
Key insight:
Security adalah property sistem, bukan fitur tambahan.
Part 031 — Observability and Operations
Logs, metrics, traces, health, runbooks.
Key insight:
Production readiness adalah kemampuan sistem untuk dioperasikan.
Part 032 — Library Design
Public API, deprecation, compatibility.
Key insight:
API internal juga user experience.
Part 033 — Modernization
Legacy, migration, refactor safety.
Key insight:
Modernization yang baik incremental dan evidence-based.
Part 034 — Capstone
Production-grade regulatory case service.
Key insight:
Semua skill menyatu di project yang punya domain, persistence, API, security, observability, dan operations.
Part 035 — Final Review
Engineering judgment.
Key insight:
Tujuan akhir bukan hafalan Python, tetapi keputusan teknis yang baik.
8. Self-Assessment Rubric
Nilai dirimu 1–5.
| Score | Meaning |
|---|---|
| 1 | Pernah dengar, belum bisa memakai |
| 2 | Bisa mengikuti contoh |
| 3 | Bisa memakai mandiri pada project kecil |
| 4 | Bisa mendesain dan menjelaskan trade-off |
| 5 | Bisa mengajari, mereview, dan memecahkan edge case production |
9. Rubric: Python Fundamentals
| Skill | Score |
|---|---|
| Syntax dasar | |
| Data types | |
| Control flow | |
| Functions | |
| Modules/imports | |
| Exceptions | |
| Iteration/generators | |
| Collections | |
| OOP/dataclass | |
| Protocol/composition |
Target top-tier: rata-rata 4+.
10. Rubric: Engineering Tooling
| Skill | Score |
|---|---|
| venv/environment | |
| pyproject.toml | |
| dependency management | |
| editable install | |
| pytest | |
| fixtures/parametrize | |
| fakes/mocks | |
| Ruff | |
| mypy/pyright | |
| CI quality gate |
Target top-tier: bisa setup project dari nol tanpa kebingungan.
11. Rubric: Application Design
| Skill | Score |
|---|---|
| Domain modelling | |
| Service layer | |
| Repository pattern | |
| Unit of Work | |
| API schema boundary | |
| Error mapping | |
| State machine | |
| Authorization policy | |
| Audit trail | |
| Dependency direction |
Target top-tier: bisa membedakan domain, application, infrastructure, API.
12. Rubric: Production Readiness
| Skill | Score |
|---|---|
| Logging | |
| Metrics | |
| Tracing concept | |
| Health/readiness | |
| Config management | |
| Secrets handling | |
| Graceful shutdown | |
| Timeouts/retries | |
| Runbooks | |
| Deployment checklist |
Target top-tier: bisa menjelaskan bagaimana sistem gagal dan bagaimana mendiagnosisnya.
13. Rubric: Advanced Runtime Judgment
| Skill | Score |
|---|---|
| GIL understanding | |
| Thread/process choice | |
| Async/event loop | |
| Cancellation/backpressure | |
| Profiling | |
| Benchmarking | |
| Memory profiling | |
| CPython internals | |
| Serialization boundaries | |
| Performance trade-off |
Target top-tier: tidak menebak; mengukur dan memilih model sesuai bottleneck.
14. Rubric: Maintenance and Evolution
| Skill | Score |
|---|---|
| Characterization tests | |
| Legacy assessment | |
| Dependency upgrade | |
| Python version upgrade | |
| Packaging migration | |
| Data migration | |
| API deprecation | |
| Backward compatibility | |
| Strangler pattern | |
| Migration playbook |
Target top-tier: bisa mengubah sistem lama tanpa merusak production.
15. Top-Tier Python Engineer Checklist
Kamu mendekati top-tier jika bisa:
- Membuat package Python modern dari nol.
- Menulis domain model yang menjaga invariant.
- Menulis tests yang meaningful.
- Menjelaskan kapan pakai dataclass vs class biasa.
- Menjelaskan
isvs==. - Menjelaskan mutability dan aliasing.
- Menjelaskan type hints runtime vs static.
- Menulis Protocol untuk dependency inversion.
- Memakai pytest fixtures tanpa over-fixturing.
- Memilih fake vs mock.
- Menggunakan Ruff/type checker/CI.
- Mendesain serialization boundary.
- Menulis custom exception hierarchy.
- Memakai logging dengan context.
- Memilih thread/process/async berdasarkan workload.
- Mengukur performance dengan profiler.
- Mengukur memory dengan
tracemalloc. - Menjelaskan GIL secara praktis.
- Mendesain FastAPI route tipis.
- Menjaga domain bebas framework.
- Mendesain repository + Unit of Work.
- Menjelaskan transaction boundary.
- Mendesain state machine eksplisit.
- Menambahkan authorization policy.
- Menghindari injection/path/deserialization risk.
- Menambahkan health/readiness.
- Menulis runbook.
- Mendesain public API stabil.
- Melakukan deprecation dengan warning dan migration path.
- Membuat modernization plan incremental.
16. Common Gaps Setelah Seri Ini
Setelah 35 part, kamu belum otomatis ahli dalam semua library.
Gap yang mungkin masih perlu didalami:
- framework-specific production deployment;
- advanced SQLAlchemy relationship/loading strategies;
- Alembic migrations;
- real authentication/OAuth/OIDC;
- distributed systems;
- message brokers;
- full OpenTelemetry deployment;
- advanced async networking;
- data science stack;
- C extension/Rust extension;
- Python packaging publishing to PyPI;
- Kubernetes operations;
- cloud-specific managed services;
- advanced cryptography;
- formal verification/property testing advanced.
Ini normal.
Seri ini memberi foundation dan judgment agar kamu bisa mempelajari gap tersebut dengan cepat.
17. How to Continue After the First 20 Hours
Stage 1 — Stabilize Fundamentals
Waktu: 1–2 minggu.
Focus:
- ulang part 006–014;
- tulis ulang
case-trackertanpa melihat materi; - pastikan tests jalan;
- tambahkan typing;
- tambahkan Ruff;
- buat README.
Goal:
Bisa membangun CLI Python maintainable dari nol.
Stage 2 — Build API
Waktu: 2–3 minggu.
Focus:
- FastAPI;
- Pydantic;
- error mapping;
- API tests;
- dependency override;
- service layer.
Goal:
Bisa expose domain service via HTTP API tanpa framework leakage.
Stage 3 — Persistence
Waktu: 2–4 minggu.
Focus:
- SQLAlchemy;
- repository;
- transactions;
- Unit of Work;
- migrations;
- integration tests.
Goal:
Bisa membangun persistence layer yang testable dan transactional.
Stage 4 — Production Readiness
Waktu: 2–4 minggu.
Focus:
- config;
- logs;
- metrics;
- health checks;
- deployment;
- runbooks;
- security baseline.
Goal:
Bisa menjelaskan bagaimana service dijalankan dan didiagnosis.
Stage 5 — Capstone Polish
Waktu: 4–8 minggu.
Focus:
- regulatory case service;
- audit;
- idempotency;
- optimistic locking;
- outbox;
- performance baseline;
- security tests.
Goal:
Portfolio-level project.
18. The 20-Hour Practice Plan Revisited
Jika kamu benar-benar ingin memakai 20 jam pertama secara intens:
| Hour | Practice |
|---|---|
| 1 | Setup environment + pyproject |
| 2 | Syntax + CLI skeleton |
| 3 | Domain model Case |
| 4 | State transitions |
| 5 | Storage JSON |
| 6 | Service layer |
| 7 | pytest domain tests |
| 8 | pytest storage/service tests |
| 9 | Exceptions/error handling |
| 10 | Typing + Protocol repository |
| 11 | Ruff/type checker |
| 12 | CLI polish |
| 13 | Logging |
| 14 | Serialization boundary |
| 15 | Performance baseline |
| 16 | FastAPI minimal API |
| 17 | API tests |
| 18 | SQLAlchemy repository sketch |
| 19 | Architecture review |
| 20 | Final refactor + README |
20 jam tidak membuatmu master. Tetapi 20 jam bisa membuatmu cukup kuat untuk self-correct.
19. What to Build Next
Build one of these:
19.1 Regulatory Case Service
Melanjutkan capstone.
Best for:
- backend engineer;
- domain modelling;
- API/persistence/security.
19.2 CLI Data Migration Tool
Features:
- JSON/CSV input;
- validation;
- dry-run;
- progress;
- report;
- error file;
- atomic writes.
Best for:
- file I/O;
- serialization;
- operational tooling.
19.3 Async Enrichment Worker
Features:
- async HTTP client;
- concurrency limit;
- retries;
- backpressure;
- outbox consumption.
Best for:
- async/concurrency/observability.
19.4 Package/Library
Create reusable case_tracker_core.
Features:
- public API;
- docs;
- tests;
- deprecation example;
- packaging.
Best for:
- library design;
- compatibility;
- typing.
19.5 Performance Lab
Features:
- large dataset;
- profiling;
- memory optimization;
- JSON vs SQLite comparison;
- benchmark docs.
Best for:
- performance/memory/CPython.
20. Interview/System Design Preparation
Be ready to answer:
Python Language
- Explain mutable default argument bug.
- Explain
isvs==. - Explain list vs tuple vs set vs dict.
- Explain generator vs list.
- Explain exception chaining.
- Explain context manager.
Tooling
- How do you structure a Python project?
- Why
pyproject.toml? - How do you manage dev dependencies?
- What checks run in CI?
- How do you use Ruff/mypy/pytest?
Testing
- Mock vs fake?
- What is contract test?
- What is property-based testing?
- How do you test file I/O?
- How do you avoid flaky tests?
Architecture
- Where should business logic live in FastAPI app?
- Why not use Pydantic model as domain model everywhere?
- What is repository pattern?
- What is Unit of Work?
- How do you enforce state transitions?
Data
- How do you handle schema evolution?
- How do you design migrations?
- How do you avoid N+1?
- How do transactions work?
- How do you handle optimistic locking?
Runtime
- What is GIL?
- When use threads/processes/async?
- How do you profile Python code?
- How do you measure memory?
- What is CPython reference counting?
Production
- What should be logged?
- What metrics matter?
- What is readiness vs liveness?
- How do you manage config/secrets?
- What is graceful shutdown?
21. Code Review Checklist for Python PRs
Use this checklist saat review:
Correctness
- Are domain invariants enforced?
- Are edge cases tested?
- Are failure modes explicit?
- Are exceptions specific?
- Is state transition valid?
Design
- Is function signature clear?
- Is dependency direction correct?
- Is framework leakage avoided?
- Is complexity justified?
- Is public API stable?
Testing
- Are tests meaningful?
- Are failure paths tested?
- Is mocking excessive?
- Are fixtures clear?
- Are integration boundaries tested?
Typing
- Are public functions typed?
- Is
Anycontained? - Are optionals handled?
- Are Protocols used appropriately?
Data
- Is input validated at boundary?
- Is serialization explicit?
- Is transaction boundary correct?
- Is migration needed?
Security
- Is authorization checked?
- Is object-level access enforced?
- Are secrets safe?
- Are injections prevented?
- Is logging safe?
Operations
- Are logs useful?
- Are metrics/health affected?
- Is config documented?
- Is rollback/migration considered?
Performance
- Is complexity acceptable?
- Any obvious N+1?
- Any unbounded memory growth?
- Was optimization measured?
22. Design Review Questions
Before building new Python feature, ask:
- What is the use case?
- What is the domain rule?
- What is the boundary input?
- What is the output contract?
- What can fail?
- Who is authorized?
- What must be transactional?
- What must be audited?
- What should be logged?
- What metric should change?
- What test proves it?
- What dependency is needed?
- What data migration is needed?
- What is the rollback path?
- What is the simplest design that satisfies this?
These questions prevent accidental complexity.
23. Personal Practice Log Template
Use after each practice session:
# Python Practice Log
Date:
Duration:
Topic:
Project:
## Goal
What did I try to learn/build?
## What I Built
## What Broke
## Traceback/Error Notes
## What I Learned
## Design Decision
## Test Added
## Next Step
## Confidence 1–5
Learning accelerates when written.
24. Capstone Final Review Template
# Capstone Review
## Domain
- Invariants:
- State machine:
- Errors:
## Application
- Commands:
- Services:
- Authorization:
- Transaction boundary:
## Infrastructure
- Repository:
- Unit of Work:
- Migrations:
- Contract tests:
## API
- Routes:
- Schemas:
- Error mapping:
- Pagination:
## Security
- Auth placeholder:
- Object-level auth:
- Input validation:
- Logging safety:
## Observability
- Request id:
- Logs:
- Metrics:
- Health:
- Runbooks:
## Testing
- Unit:
- Contract:
- Integration:
- API:
- Security:
- Performance:
## Risks
## Next Improvements
25. “Pythonic” Revisited
Pythonic bukan berarti:
- kode paling pendek;
- comprehension paling rumit;
- magic paling banyak;
- dynamic trick paling clever.
Pythonic berarti:
- readable;
- explicit where it matters;
- simple common path;
- idiomatic data structures;
- clear names;
- good errors;
- minimal surprise;
- tests;
- maintainable boundaries;
- practical use of language features.
The Zen of Python sering diringkas menjadi readability, explicitness, simplicity, dan practicality. Tetapi top-tier engineer tahu bahwa “simple” bukan berarti “under-designed”.
Simple berarti:
Complexity berada di tempat yang tepat.
26. Final Mental Model: Boundary-Centric Python
Banyak keputusan Python bisa disederhanakan dengan boundary thinking.
At each boundary, ask:
- What data crosses?
- Is it trusted?
- Is it validated?
- What type represents it?
- What errors can happen?
- What logs/metrics should exist?
- What transaction is needed?
- What test covers it?
This applies to:
- CLI args;
- HTTP request;
- JSON file;
- database row;
- queue message;
- external API response;
- plugin call;
- library public API.
Boundary clarity is a top-tier skill.
27. Final Anti-Patterns to Avoid
- Learning only syntax.
- Writing code without tests.
- Treating type hints as runtime validation.
- Letting dicts invade domain logic.
- Catching
Exceptionand hiding failures. - Using global mutable state.
- Overusing mocks.
- Adding dependencies casually.
- Mixing framework and domain.
- Ignoring packaging.
- No CI quality gate.
- No logging context.
- Optimizing without measurement.
- Using async for everything.
- Using threads for CPU-bound speedup without evidence.
- Ignoring security until late.
- No migration plan.
- Breaking public API without deprecation.
- Writing clever code nobody can maintain.
- Confusing “works” with “production-ready”.
28. Final Positive Patterns
- Small cohesive functions.
- Explicit domain model.
- Value objects for important identities.
- Specific exceptions.
- Pure core, imperative shell.
- Repository Protocol.
- Unit of Work for transactions.
- Boundary schemas.
- Fakes + contract tests.
- Parametrized state-machine tests.
- Standard library first.
- Reproducible packaging.
- Quality gate in CI.
- Structured logging.
- Health/readiness checks.
- Measurement-driven optimization.
- Incremental modernization.
- Backward-compatible API evolution.
- Runbooks.
- Written design decisions.
29. Recommended Reference Habits
When unsure:
- Read official Python docs.
- Create minimal reproduction.
- Write a test.
- Inspect traceback.
- Use
dir,help,inspectif needed. - Use
disonly for insight. - Profile before optimizing.
- Check package docs/changelog.
- Search issue tracker for library-specific bug.
- Document final decision.
Do not rely solely on snippets from random posts. Use snippets to learn possibilities, then verify.
30. Final Project Artifacts Checklist
For a serious Python project, aim for:
pyproject.toml
README.md
CHANGELOG.md
LICENSE
Makefile / task runner
src/
tests/
docs/
.github/workflows/ci.yml
.pre-commit-config.yaml
Quality:
python -m ruff format --check .
python -m ruff check .
python -m mypy src tests
python -m pytest
Runtime:
- config object;
- logging config;
- health endpoints if service;
- migration tooling if database;
- dependency lock if app;
- runbooks.
31. Suggested 90-Day Mastery Plan
Days 1–15: Rebuild case-tracker
- CLI;
- JSON storage;
- tests;
- typing;
- tooling.
Days 16–30: Add API
- FastAPI;
- Pydantic schemas;
- error mapping;
- API tests;
- dependency overrides.
Days 31–45: Add SQL Persistence
- SQLAlchemy;
- migrations;
- repository;
- Unit of Work;
- transaction tests.
Days 46–60: Add Production Readiness
- config;
- logs;
- metrics;
- health;
- runbooks;
- security baseline.
Days 61–75: Add Advanced Reliability
- audit trail;
- idempotency;
- optimistic locking;
- outbox worker;
- async enrichment.
Days 76–90: Polish and Publish Portfolio
- docs;
- architecture diagrams;
- performance baseline;
- deployment guide;
- migration guide;
- final code review.
At the end, you should have portfolio-level evidence of engineering maturity.
32. Final Exam: Build Without Looking
Challenge:
Build a small but serious service from scratch without looking at previous code.
Requirements:
pyproject.toml.srclayout.- Domain model with value object and enum.
- Service layer.
- Repository Protocol.
- Fake repository.
- JSON or SQLite repository.
- FastAPI API.
- Pydantic schemas.
- Error handlers.
- pytest unit/API tests.
- Ruff config.
- Type checker config.
- Logging.
- Health endpoint.
- README quickstart.
Timebox: 8–12 hours.
Then compare with capstone rubric.
This is the real test of transfer.
33. Final Reflection Questions
Answer in writing:
- What Python concept changed how I think?
- Which bug class do I now understand better?
- Which tool gives me most leverage?
- Which topic still feels fuzzy?
- What part of capstone would I implement first?
- Where did I over-engineer?
- Where did I under-design?
- What is my next 20-hour target?
- What project will prove my skill?
- What will I teach someone else?
Teaching one concept is a strong mastery check.
34. Completion Checklist for This Series
You have completed the series if:
- Part 001–035 exist.
- You understand the roadmap.
- You built or can build the mini project.
- You can explain object/reference/mutability.
- You can write tests with pytest.
- You can setup tooling.
- You can package a project.
- You can design API boundary.
- You can design persistence boundary.
- You can explain concurrency choices.
- You can profile before optimizing.
- You can add observability.
- You can identify security risks.
- You can modernize legacy code incrementally.
- You can explain capstone architecture.
If some items are weak, revisit the corresponding part.
35. Final Words
Python mastery is not about memorizing every feature.
It is about knowing how to think:
- What is the boundary?
- What is the invariant?
- What can fail?
- What is the contract?
- What must be tested?
- What must be measured?
- What must be logged?
- What must be secured?
- What must evolve?
- What is the simplest design that remains safe?
The first 20 hours give momentum. The next 200 hours build fluency. The next 2,000 hours build judgment.
But judgment is not automatic. It grows when you:
- build real things;
- read good code;
- review bad code respectfully;
- debug production-like failures;
- write tests;
- write docs;
- measure;
- refactor;
- teach;
- revisit assumptions.
This series is complete. The next step is not another tutorial.
The next step is to build, measure, review, and improve.
36. Referensi Lanjutan
Gunakan referensi resmi dan primary sources terlebih dahulu:
- Python Documentation.
- Python Packaging User Guide.
- pytest Documentation.
- Ruff Documentation.
- mypy or Pyright Documentation.
- FastAPI Documentation.
- Pydantic Documentation.
- SQLAlchemy Documentation.
- OpenTelemetry Documentation.
- OWASP Top 10 and ASVS.
- CPython Developer Guide, jika ingin internals lebih dalam.
37. Status Seri
Seri learn-python selesai pada Part 035.
File terakhir:
learn-python--part-035.mdx
Total:
35 parts
Selamat. Kamu sekarang punya peta lengkap untuk bergerak dari “bisa Python” menuju “mampu mendesain, membangun, mengoperasikan, dan memodernisasi sistem Python dengan judgment software engineering yang kuat.”
You just completed lesson 35 in final stretch. Use the series map if you want to review the broader track, or continue directly into the next lesson while the context is still warm.
Keep the momentum while the lesson is still fresh. Move backward for review or continue forward into the next concept.