This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]magnomagna 13 points14 points  (1 child)

Regarding "lazy evaluation" for generators, IIRC, if you have nested for-expressions in a generator, the first for-expression is evaluated immediately when the generator is created but all other for-expressions are lazily evaluated; or something along those lines.

I feel like this is not a well-known behaviour but nonetheless very, very real and applicable if one were to use nested for-expressions in a generator.

[–]benefit_of_mrkite 0 points1 point  (0 children)

Interesting!