Learn how to create generator functions, and how to use the "yield" statement. Generator functions are a special kind of function that return a lazy iterator. These are objects that you can loop over like a list. However, unlike lists, lazy iterators do not store their contents in memory.
You'll also compare list comprehensions and generator expressions. Once you have learned the difference in syntax, you'll compare the memory footprint of both, and profile their performance using cProfile.
Click here to learn more: https://realpython.com/courses/python...
На этой странице сайта вы можете посмотреть видео онлайн Generators in Python длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Real Python 18 Июнь 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 8,102 раз и оно понравилось 294 зрителям. Приятного просмотра!