...

/

Mixing Native & Generator Based Coroutines

Mixing Native & Generator Based Coroutines

This lesson demonstrates how generator-based coroutines and native coroutines can be interoperable.

We'll cover the following...

Mixing Native & Generator Based Coroutines

In order to maintain backward compatibility, generator-based coroutines can work with native coroutines by using appropriate decorators. In this lesson, we first look at the differences between the two types of coroutines and then examine the decorators that can be used to make the two work with each other.

Native Coroutines vs Generator-based Coroutines

Generator based coroutines and native coroutines have differences between themselves which are listed below:

  • Native coroutines don't implement the __iter__() and __next__() ...