Python's yield keyword is rarely useful for laziness. I've only taken advantage of lazy computation a handful of times, e.g. dealing with paginated APIs.
The main advantage is syntactic sugar for producing iterables. Yield is much nicer than appending to a list and returning it!
Related Posts
I'm designing a programming language and trying to decide the type of `let x = 1;`. Should it be Unit or Int?
Advantage of Int: really convenient when evaluating snippets in a REPL.
Advantage of Unit: It's much less confusing when type inference runs on an incomplete function.
I like that most LLM UIs show your previous queries prominently.
When figuring out where LLMs are useful in your workflow, it's nice to see what worked well (or not) in the past.
Web search doesn't have this property. I rarely look at what I've previously googled.
I've been playing with labels on my code blocks. Sometimes I have useful labels, other times it's just "Example 2".
It's also unclear exactly where I put the label: Inside the box? Outside?
Are there any docs sites that do this really well?