[Tutor] implied tuple in a list comprehension

ALAN GAULD alan.gauld at btinternet.com
Fri Aug 2 21:26:31 CEST 2013



>>  t = (6,)  # t=6,  works but is much harder to see.
> 
> That could lead to awful bugs, since it really is hard to see, and
> hitting the comma is a mistake I often make. I think I may stick with
> always using parentheses for tuples. Some conveniences aren't that
> convenient.


And this from the man who hates extra typing! ;-)

Alan g.



More information about the Tutor mailing list