computing with characters

Marco Mariani marco at sferacarta.com
Wed Apr 30 07:38:38 EDT 2008


Torsten Bronger wrote:

> However, join() is really bizarre.  The list rather than the
> separator should be the leading actor.

No, because join must work with _any sequence_, and there is no 
"sequence" type to put the join method on.
This semantic certainly sets python apart from many other languages.

 >>> '-'.join(c for c in 'hello')
'h-e-l-l-o'
 >>>



More information about the Python-list mailing list