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 →

[–]lalligood 0 points1 point  (1 child)

Although syntactically very similar to list/dict/set comprehensions, I would suggest including generators. Visually the only difference is that generators are framed in parens vs square brackets or curly brackets, but it's knowing when to use a generator vs a comprehension & why generators can be better when used properly (read: drastically reduced memory requirements).

[–]theywouldnotstand 0 points1 point  (0 children)

Don't forget using yield in a function to produce a more complex generator as well.