Skip to main content
Back to course
Log in
Get started
Someone wanted to learn this too, so Grasp built them a personal learning path.
Create your own
Asyncio and async iterators
ยท
Module 1
Foundations of Iteration in Python
1
Iterables vs. Iterators in Python
Differentiate between an iterable and an iterator in Python, providing examples of each.
Differentiate between an iterable and an iterator in Python, providing examples of each.
2
Building Custom Iterators with __iter__ and __next__
Implement a custom iterator class using the `__iter__` and `__next__` methods.
Implement a custom iterator class using the `__iter__` and `__next__` methods.
3
Understanding StopIteration in Iterators
Explain the role of the `StopIteration` exception within the iterator protocol.
Explain the role of the `StopIteration` exception within the iterator protocol.
4
Understanding Generator Functions and Yield
Define a generator function using the `yield` keyword and explain how it differs from a regular function.
Define a generator function using the `yield` keyword and explain how it differs from a regular function.
5
Generator Execution: Suspending and Resuming State
Trace the execution of a generator function to describe how its state is suspended and resumed.
Trace the execution of a generator function to describe how its state is suspended and resumed.
6
Infinite Sequences: Generation and Finite Consumption
Write a generator for an infinite sequence and demonstrate consuming a finite portion of it.
Write a generator for an infinite sequence and demonstrate consuming a finite portion of it.
Previous module
Next module
Introduction to Asynchronous Programming