Vladimir

64%
Flag icon
It makes sense that these are covariant, because any code expecting a coroutine that yields floats can use a coroutine that yields integers. That’s why Generator is covariant on its YieldType parameter. The same reasoning applies to the ReturnType parameter—also covariant.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview