FreeShort Course

Advanced Python Programming

Core Language Internals: the iterator protocol and lazy generators, closures and decorators, dunder methods, descriptors and metaclasses, context managers and the memory model, through to threading, multiprocessing and asyncio concurrency - five modules, one Compiler Quest per topic.

FreeNo fee
5 weeks15 hours
Short CourseBeginner to Intermediate
OnlineLive & instructor-led

About this course

Core Language Internals: the iterator protocol and lazy generators, closures and decorators, dunder methods, descriptors and metaclasses, context managers and the memory model, through to threading, multiprocessing and asyncio concurrency - five modules, one Compiler Quest per topic.

This is a 6-week short course - enough depth to build real projects and a portfolio piece, without a long commitment. Learn online at your own pace. Practice the concepts with the listed assessments.

What's included

  • Self-paced lessons and practice (15 estimated hours).
  • Hands-on coding quests you solve inside the EchoLens browser compiler - nothing to install.
  • Gems, stages and a leaderboard that keep you moving instead of grade anxiety.
  • A verified certificate with a scannable QR code, ready to share on LinkedIn, when you satisfy the course requirements.
  • Completely free - no fee, just create an account and start.

What you will learn

Iterator protocol (__iter__, __next__)Generators & yieldmap, filter, reduce & functoolsClosures & function factoriesFunction decorators & functools.wrapsDecorators with arguments & class decoratorsDunder methods (__repr__, __eq__, __getitem__, __call__)Descriptors & attribute interceptionAbstract base classes & metaclassesCustom context managers (__enter__, __exit__)contextlib & @contextmanagerGarbage collection, __slots__ & weakrefThreading, multiprocessing & the GILThread synchronization (Lock & Queue)Async programming with asyncio

Course outline - level by level

15 leveles, each with hands-on quests you clear in the portal.

  • Level 1. Iterator Protocol (__iter__, __next__) - Real-life analogy: Think of a mechanical ticket-roll dispenser that serves one numbered ticket every time a customer pulls the lever, and raises a little flag the moment the roll runs empty. A Python iterator implements __iter__() (which returns the iterator object itself) and __next__() (which returns the next value, or raises StopIteration once the elements are exhausted). Building your own iterable lets you evaluate lazily over a huge - even endless - stream without ever holding all of it in RAM at once.
  • Level 2. Generators & yield Statements - Real-life analogy: Think of a chef who cooks each dish on demand as an order reaches the counter, pausing between orders - rather than cooking ten thousand meals in advance and letting them go cold. A generator function uses yield to produce values one at a time, suspending its own execution between calls and resuming exactly where it left off. It holds only the current state in memory, so it can walk a gigabyte-scale dataset in constant space.
  • Level 3. Built-in Functional Tools (map, filter, reduce, functools) - Real-life analogy: Think of an automated factory conveyor: each package is reshaped at one station (map), defective items are kicked off the belt at the next (filter), and finally every remaining weight is added into a single gross payload total (reduce). Python's functional primitives - map(), filter() and functools.reduce() - describe a transformation as a pipeline rather than a loop with mutable accumulators. functools.partial pre-binds arguments so small, reusable step functions compose cleanly.
  • Level 4. Closures & Function Factories - Real-life analogy: Think of a customised stamp tool pre-loaded with one department's ink. Wherever you carry it, every impression it makes still carries that same department's mark. A closure is an inner function that keeps access to variables from its enclosing function's scope even after that outer function has returned. A function factory uses this to manufacture specialised functions, each carrying its own captured configuration.
  • Level 5. Function Decorators & functools.wraps - Real-life analogy: Think of slipping a waterproof case onto a phone. The phone does exactly what it did before, but every interaction now passes through an added layer of protection. A decorator is a callable that takes a function and returns a replacement wrapping extra behaviour around it, applied with @decorator syntax. Wrapping the inner function with @functools.wraps(func) copies across the original name, docstring and signature so introspection still works.
  • Level 6. Decorators with Arguments & Class Decorators - Real-life analogy: Think of a security scanner whose alarm sensitivity is dialled to a different threshold depending on whether it is screening carry-on bags or heavy cargo freight. A decorator that takes its own arguments needs a three-level nest: the outer call captures the arguments, the middle layer receives the function, and the inner layer runs it. A class-based decorator instead implements __call__, which lets it keep state cleanly across every invocation of the wrapped function.
  • Level 7. Advanced Dunder Methods (__repr__, __eq__, __getitem__, __call__) - Real-life analogy: Think of teaching a custom-built vehicle to respond to the universal controls every driver expects - the accelerator, the brake pedal, and the diagnostic port on the dashboard. Special "dunder" (double-underscore) methods plug a class into Python's own syntax: __repr__ gives a useful debugging string, __eq__ defines ==, __getitem__ enables obj[k] indexing, and __call__ makes an instance callable like a function.
  • Level 8. Property Descriptors & Attribute Interception (__getattr__, __setattr__) - Real-life analogy: Think of a smart building system that intercepts every attempt to change a room's thermostat, checking the requested temperature is sane before it ever lets the furnace fire. The descriptor protocol (__get__, __set__, __delete__) is the machinery behind @property: a descriptor is a class attribute that runs code on access. __getattr__ and __setattr__ intercept attribute access on an instance, enabling validation, defaults and proxying.
  • Level 9. Abstract Base Classes (abc module) & Metaclasses - Real-life analogy: Think of a national industrial standard that requires every compliant engine factory to produce a certified mounting bracket before it is allowed to open its doors at all. The abc module enforces a structural contract: a class with an @abstractmethod cannot be instantiated until a subclass implements that method. Metaclasses go one level deeper - by inheriting from type they customise class creation itself, powering automatic subclass registration and field validation.
  • Level 10. Custom Context Managers (__enter__, __exit__) - Real-life analogy: Think of borrowing a book from a library - the check-out is logged as you walk in, and the security scan and any late fee are settled automatically as you pass back through the door, whether or not you finished the book. The with statement calls __enter__() to acquire a resource and __exit__() to release it - and __exit__ runs even if the block raises an exception, making it the reliable place for cleanup.
  • Level 11. contextlib Utilities (@contextmanager) - Real-life analogy: Think of an express checkout lane that folds scanning and bagging into one smooth motion, instead of two separate stations. The @contextlib.contextmanager decorator turns a generator with a single yield into a full context manager: everything before the yield is the __enter__ work, the yielded value is the "as" target, and everything after (ideally in a finally) is the __exit__ cleanup - no boilerplate class required.
  • Level 12. Garbage Collection, __slots__ & weakref - Real-life analogy: Think of designing a micro-apartment with a fixed set of built-in wall cubbies instead of bulky movable closets - the same storage in a fraction of the footprint and cost. CPython frees objects by reference counting, with a cyclic collector for reference loops. Declaring __slots__ removes each instance's per-object __dict__, cutting memory sharply, and weakref lets one object refer to another without keeping it alive, breaking reference cycles.
  • Level 13. Threading vs Multiprocessing & the GIL - Real-life analogy: Threading is two cooks sharing a single kitchen counter - fine while they are mostly waiting on phone orders, but a bottleneck when both need to chop at once. Multiprocessing is building two separate kitchens in two separate buildings. The Global Interpreter Lock (GIL) lets only one thread execute Python bytecode at a time, so threading helps I/O-bound work (network, disk) but not CPU-bound work. multiprocessing sidesteps the GIL by running separate interpreter processes on separate cores.
  • Level 14. Thread Synchronization with Lock & Queue - Real-life analogy: Think of a single-teller bank desk with a velvet-rope queue and a locked cash drawer - only one customer is served at a time, and no two hands ever reach into the drawer at once. When threads share mutable state, unsynchronised updates race and corrupt it. threading.Lock gives mutual exclusion, cleanest as "with lock:", and the thread-safe queue.Queue hands work between producer and consumer threads without any explicit locking.
  • Level 15. Asynchronous Programming with AsyncIO (async / await) - Real-life analogy: Think of a chess grandmaster playing fifty opponents at once. Rather than standing at board one waiting for a reply, the master plays a move, walks to board two, and only returns to board one once that opponent has moved - one person, many games in flight. asyncio is single-threaded cooperative multitasking: a coroutine defined with async def gives up control at each await during I/O, and asyncio.gather() runs many coroutines concurrently on one event loop, ideal for thousands of simultaneous network calls.

How you submit: Coding quests solved in the built-in EchoLens compiler.

Who it's for

Advanced Python Programming suits learners at a beginner to intermediate level who want a practical, project-based route into Advanced Python Programming. You need only a browser and an internet connection - all coding runs inside the EchoLens compiler, so there is nothing to set up.

Certificate

Pass every required assessment at its stated threshold to earn your verified certificate. Optional practice and watching videos do not determine eligibility. Anyone can scan its QR code to verify it on our site. You can add it to your CV or share it to LinkedIn in one click.

More Short Courses

Python for Data ScienceRs 12,500 · 6 weeksGenerative AI EssentialsRs 14,000 · 6 weeksData Analytics with SQL & Power BIRs 13,500 · 6 weeksIntroduction to Machine LearningRs 13,000 · 6 weeks