Generators, Coroutines, and Nanoservices
Offered By: EuroPython Conference via YouTube
Course Description
Overview
Explore the advanced features of Python generators, coroutines, and nanoservices in this EuroPython 2021 conference talk. Delve into the lesser-known aspects of generators, including the "send" method and "yield from" syntax. Learn how to conceptualize coroutines as in-process nanoservices and determine their appropriate use cases. Discover generator function basics, the differences between next and send, coroutine construction techniques, and the implementation of sub-coroutines. Gain insights into practical applications of these concepts through examples such as MD5 hashing and weather data processing. Understand the relationship between coroutines and asyncio, and develop criteria for deciding when to incorporate coroutines in your Python projects.
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
Related Courses
Design Patterns in Modern C++Udemy Unity GameObject Singletons: Best Practices
Pluralsight C# Scripting in Unity: Beyond the Basics
Pluralsight Android Development Essential Training: Manage Data with Kotlin
LinkedIn Learning Intermediate Kotlin for Android Developers
LinkedIn Learning