Dennis Lee Bieber wrote: > On Wed, 07 Mar 2007 17:15:33 +0100, Laurent Pointal > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> >> How a Python beginner know that he is using a generator and not a >> list-comprehension ? >> > A list comprehension ALWAYS has list brackets [...] around it...
Yes, and a generator expression ALWAYS has round brackets... which can be confused with function call ones when it is used in a single argument function call... I still personnaly think function call round brackets and generator expression round brackets should both be present. -- http://mail.python.org/mailman/listinfo/python-list