Python Generators

preview_player
Показать описание
Python generators are lazy sequences and pausable functions.

SUPPORT ME ⭐
---------------------------------------------------

Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, John Martin, Mutual Information

BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------

CHAPTERS
---------------------------------------------------
0:00 Intro
0:16 Defining generators
1:55 Iterators and Range
3:49 File processing
4:55 Lazy sequences and Collatz
7:19 Generator comprehensions
8:05 Generator pipelines
9:49 Advanced usage, send/throw/close
13:05 Yield from
15:12 Thanks
Рекомендации по теме
Комментарии
Автор

I love the relatively monotone presentation, which helps clarity, with only a few incredibly well placed jokes sprinkled here and there. Keep it up!

biffenb
Автор

No matter how experienced you are, in your videos there is always a new small detail you didn't know about. Love it!

lluchi
Автор

Mate, I have years of Python experience, yet everytime you release a video I am floored by some of the stuff you showcase and I feel like I'm learning about the language for the first time. Stellar job, as always, and your presentation style is excellent for the job.

SwissTHXEB
Автор

Dude, you are a genius. I wonder why your vids aren't getting more views than those other millions of python hacks out there. Keep up the good work.

adsfwef
Автор

Async (vs threading vs "other kinda-multitasking methods") video would be greatly appreciated. It's not the most useful stuff for your average script or simple program, so I rarely see good explanations of it for any language.

ssholum
Автор

Always struggled with generators. Thanks for the amazing explanation!

dhravya
Автор

I swear every time I start watching a video on this channel I think “ah here is another thing I already know in python I probably won’t learn anything new this topic is pretty straight forward” and I end the video feeling like I never knew anything about it to begin with 😂😂 keep up the great work

LettuceAttack
Автор

Your async explanation would be much appreciated! :)

mabml
Автор

“Even if a file is gigabytes large you’ll only need enough memory to handle a single line” great point!

GlutesEnjoyer
Автор

I write things like "sum(x for x in range(10))" very often and I didn't know that was generator comprehension! I was thinking it was the same as writing "sum([x for x in range(10)])" (with brackets). Thanks a lot for your content!

Fikerus
Автор

Very insightful video! One other place I've seen generators used frequently is for API pagination. If, for instance, if you want to get all 100 records from an API, and the API limits your query to 10 records per call, you may not want to wait for all 10 calls. Instead you create a generator that calls the API only when you've completed working with the first page and are ready to move onto the second, etc.

Gamecrazy
Автор

"Where the only limit, is your imagination... and your download speed" - LOL I lost it here

rituchandra
Автор

Outstanding video as always.
itertools might have deserved a mention since it is very useful with generators.
The jump from iterator to coroutine was a bit steep and I would personally love an async video

vincentperrollaz
Автор

This is why I like your channel: Even when I think I know a topic well, I still expect to find something new in your videos, and I always do. Keep it up!

ahmadhesham
Автор

Great video. It was eye opening for me when I learnt about generator comprehension. I realised that I was doing something very inefficient passing list comprehensions to sum and other functions.

Also worker example is amazing. Never used it this way.

MessLeadingProgramming
Автор

Thank you! By learning this I was able to create a toy version of the async coroutines, helped me a lot to grasp the concept of event loops

k_gold
Автор

Just as I was about to suggest a video on async, James announced it himself. 👍🏻
Can't wait to see this convoluted topic explained in mCoding simple comprehensible manner.

lex_darlog_fun
Автор

Thank you so much for this video, and all of others. I've started reading Fluent Python a couple months ago, but that was quite hard for me to go through it. And you on your channel describe those hard for me things and I finally get them somehow. Thought I was dumb, but all i needed was to find a great lecturer. Thank you so much!

wojasek
Автор

Your videos are going into great depth mate! Im awaiting for that async vid of yours

pankller
Автор

Yep, definitely interested in an async video. Especially interested in learning the "python native" async features and components so as to detangle it from all the third-party contributed stuff.

TylerLarson
welcome to shbcf.ru