Generator functions in Python

Опубликовано: 20 Октябрь 2024
на канале: Python Morsels
312
20

When you call a generator function it doesn't actually run the function; instead it returns a generator object.

Read an article version of this video at https://pym.dev/what-is-a-generator-f...

Find more Python screencasts at https://pym.dev/screencasts/

00:00 A regular function in Python
00:23 A generator function in Python
01:00 Generator objects put themselves on pause
02:00 Generator objects are lazy iterables
03:25 A function with yield statements is a generator function