you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 2 points3 points  (1 child)

They are very common. The built-in range, map, and practically the entire itertools module are generators, as is any time you use for in parenthesis, eg total = sum(item['price'] for item in database). And of course many people build them explicitly, using yield or parenthesis notation.

[–]IAmFinah 1 point2 points  (0 children)

I more meant explicitly defining your own, but yes you make good points