Learning Generators in Python by Skinning the Snake

preview_player
Показать описание
A tutorial on python generators, iterators and iterables, through jokes and hopefully fun.

Edited by:

Join the discord:

#python #generators #tutorial #guide #coding #learning #programming

00:00 - intro
00:38 - laziness
01:44 - a lost cake
02:13 - generators and iterators
4:27 - yield and generator functions
6:14 - yield patterns
7:14 - send and throw
8:02 - outro
Рекомендации по теме
Комментарии
Автор

Probbably the best (and most entertaining) explanation of the concept of iterating in Python. I'm glad to finally have something to recommend when asked about Python basics, since now I don't have to worry about missing something, being busy or having to repeat myself due to lacking visual aids.

playerguy
Автор

I used a generator for a SQL project to allow chunking through query results. Useful where useful, but typically slower and less efficient than a list comprehension.

kkiller
Автор

Shouldn't the except clause in the iterator example have "break" instead of "pass"?

kkiller
join shbcf.ru