Talk Python To Me cover image

#25: Effective Python

Talk Python To Me

00:00

Python's Yield Semantics

If you're going to return a lot of data, just make that function a generator rather than returning a list. And I think just having functions that return that are generators lets you kind of start with the leaves and move up to make things streaming. It's so easy to just throw in a yield instead of a list, not a panda or whatever, right? Yeah, exactly. It's very clear. And what's interesting is that, you know, JavaScript and other languages are adopting the yield semantics because it's such a powerful tool that people love to use. But knowing and sort of raising awareness is great.

Play episode from 24:39
Transcript

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app