Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Generators, Coroutines, and Nanoservices

EuroPython Conference via YouTube

Overview

Google, IBM & Meta Certificates – 40% Off
One Coursera Plus subscription covers most Professional Certificates on Coursera.
Unlock All Certificates
This talk explains Python generator functions and how to use them to build coroutines. It demonstrates `send` and `yield from` and discusses when coroutine-based nanoservices are useful.

Syllabus

Intro
The dumbest function in the world
Bytecode from our function
What about this function?
What's the difference?
Bytecodes
What's a generator?
How does a "for" loop work
What about with our generator?
Doing it manually
"next" and generators
fib
Generator example 2: read_n
next_vowel
So, when do we use generators?
"yield" as an expression
The "send" method
Walrus yield
How can I use coroutines?
Coroutine as "nanoservices"
Example: MD5
Coroutine example 1: MD5
Coroutine example 2: Weather
Coroutine example 2.1: Weather
Coroutine example 3
Ending early
Revisiting the weather
Megaservices
Refactoring our generator
"yield from" to the rescue!
What about asyncio?
Should you use coroutines?

Taught by

EuroPython Conference

Reviews

Start your review of Generators, Coroutines, and Nanoservices

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.