How to generate k+1 length strings from a list of k length strings?

Boris Borcic bborcic at gmail.com
Fri Jun 9 05:59:43 EDT 2006


bearophileHUGS at lycos.com wrote:

> It's not that difficult to improve the readability of a quite long
> line, you can start splitting it.

The point is that it is observer and context dependent whether

res = set(''.join(sorted(X|Y))
                  for X in sets
                      for Y in sets
                          if len(X^Y)==2)

is measurably easier to read than

res = set(''.join(sorted(X|Y)) for X in sets for Y in sets if len(X^Y)==2)

*and* that I acknowledged it by writing "I find most readable"
while you denied it by speaking of "the readability" - and similar language.





More information about the Python-list mailing list