Advanced Python for Professionals: Syllabus

Duration: 12 weeks, about 5 hours a week (2 hours of lecture and reading, 3 hours of hands-on labs)

Prerequisites: 1+ year of working Python (functions, classes, modules, basic pandas or web experience)
Outcome: Write, test, ship and optimize production-grade Python, and build a deployable capstone project.


Module 1: Language Mastery (Weeks 1-3)

Week 1: Python Data Model and Internals

  • Object model, references, mutability, and memory management.
  • Dunder methods, operator overloading, and custom containers.
  • The GIL, CPython bytecode (dis), and the garbage collector.
  • Lab: Build a custom Vector/Matrix class with full operator support.

Week 2: Advanced Functions and OOP

  • Closures, decorators (with arguments, class-based), and functools
  • Context managers (contextlib) and descriptors
  • Metaclasses, __init_subclass__, dataclasses, Protocol, and ABCs
  • Lab: Build a retry/caching/timing decorator library

Week 3: Iterators, Generators and Functional Patterns

  • Iterator protocol, generators, yield from, and generator pipelines
  • itertools, collections, and comprehension patterns
  • Lazy evaluation and streaming large files
  • Lab: Process a multi-GB log file in constant memory

Module 2: Production-Grade Engineering (Weeks 4-6)

Week 4: Typing and Code Quality

  • Type hints, generics, TypedDict, Literal, and ParamSpec.
  • Static checking with mypy/pyright
  • Validation with pydantic; linting and formatting with ruff
  • Lab: Fully type and lint an untyped legacy module

Week 5: Testing

  • pytest fixtures, parametrization, and mocking
  • Property-based testing with Hypothesis
  • Coverage, test architecture, and testing async code
  • Lab: Reach 90%+ meaningful coverage on a sample service

Week 6: Packaging, Tooling and Delivery

  • Project layout, pyproject.toml, and uv/poetry
  • Building and publishing packages
  • Docker for Python, CI/CD with GitHub Actions, and pre-commit hooks
  • Lab: Package a library and publish it to a test index with a CI pipeline

Module 3: Performance and Concurrency (Weeks 7-9)

Week 7: Profiling and Optimization

  • cProfile, line_profiler, memory_profiler, and timeit
  • Algorithmic and data-structure optimization
  • NumPy vectorization, numba, and Cython basics
  • Lab: Speed up a slow numeric routine by 20x or more, with benchmarks

Week 8: Concurrency I (Threads and Processes)

  • Threading vs multiprocessing, and when the GIL matters
  • concurrent.futures, queues, and shared state
  • Free-threaded Python builds: status and trade-offs
  • Lab: Parallelize a CPU-bound and an I/O-bound task, and compare

Week 9: Concurrency II (asyncio)

  • Event loop, tasks, async/await, and structured concurrency
  • Async HTTP and database clients, backpressure, and cancellation
  • Lab: Build an async web scraper or API aggregator with rate limiting

Module 4: Architecture and Applied Track (Weeks 10-11)

Week 10: Design and Architecture

  • Dependency injection, repository and service-layer patterns, hexagonal architecture
  • Error handling strategies, logging, observability, and configuration
  • Designing public APIs and managing deprecations

Week 11: Choose One Track

  • Backend: FastAPI, SQLAlchemy 2.0, migrations, auth, Celery/Redis task queues
  • Data engineering: Polars/pandas at scale, pipelines with Prefect/Airflow, Parquet and DuckDB
  • ML/AI serving: model packaging, FastAPI inference services, monitoring
  • Automation/DevOps: CLI tools with Typer, cloud SDKs, infrastructure scripting

Module 5: Capstone (Week 12)

Build and present a typed, tested, containerized service or library that includes:

  • Clean architecture with documented design decisions
  • A CI pipeline (lint, type check, tests, build)
  • At least one profiled and documented performance improvement
  • A README, API docs, and a short demo

Assessment and resources

The capstone and weekly labs carry 75% of the final grade.

Component

Weight

Weekly labs

40%

Mid-course code review (Week 6)

15%

Capstone project

35%

Peer review participation

10%

  • Fluent Python (Luciano Ramalho): the core text for Weeks 1-3
  • Architecture Patterns with Python (Percival and Gregory): Week 10
  • High Performance Python (Gorelick and Ozsvald): Weeks 7-8
  • Official docs: typing, asyncio, and the pytest and Hypothesis documentation







No comments:

Post a Comment

Advanced Functions and Object-Oriented Python

Level: Intermediate to advanced Suggested time: 5–7 hours Python: 3.10+ (examples use standard-library features) This week moves beyond w...