Nick Coghlan schrieb:
data = [['foo','bar','baz'],['my','your'],['holy','grail']] result = [] for d in data:
.>>> data = [['foo','bar','baz'],['my','your'],['holy','grail']] .>>> from itertools import chain .>>> result = "".join(chain(*data)) 'foobarbazmyyourholygrail'
This is the first time I see that and I totally like the idea of writing ".>>>" instead of ">>>" at the beginning of a line. Thank you Dr. Dobb! It's unfortunate for c.l.py that Python uses ">>>" as the default prompt as it messes up the display on mail/news readers that provide "syntax highlighting" for quotes.
I wish everyone would write examples that way! On the other hand - three levels of quoting are really rare, maybe it would be easier to change that in the mail readers...
... or in Py3k ?
Stefan -- http://mail.python.org/mailman/listinfo/python-list