Python Series track

Week 02

Week 2 — Decorators & Context Managers

Master decorators for cross-cutting concerns like logging, caching, and timing. Then implement reusable context managers with both the class-based and contextlib.contextmanager approaches.

Advanced Track5 topicsFree · open source

What this lesson covers

5 topics from the advanced track section of the Python Series track. Work through the source materials alongside these concepts.

  • functools.wraps
  • Stacking
  • Class decorators
  • __enter__
  • __exit__

Lesson materials

README, runnable examples and exercises for every Python Series lesson live in the open-source repository.

Open the source repository

Learn this lesson with a mentor

Work through the Python Series track on your own, or join a guided cohort at our Pitampura campus and online.

Call NowEnroll Now