Sorry about the top posting. I'm new to mailing lists. I should just reply to the python-list@python.org address then?
Also, thank you for the generator clarification. On Mar 8, 2016 9:09 AM, "jmp" <jeanmic...@sequans.com> wrote: > On 03/08/2016 05:49 PM, justin walters wrote: > >> Correct me if I'm wrong, but don't python generators usually use the yield >> statement so they can be used in list comprehensions? >> > > Hello, > > Please don't top post. > > Generator expressions are different from generator functions. They are > both generators but use a different syntax. > > generator function: > > def func(iterable): > for i in iterable: yield i > > > the generator expression version would be > > (i for i in iterable) > > > Both have their use cases but everytime you can actually use an generator > expression, it's probably the correct thing to do. > > Cheers, > > jm > > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list