Re: computing with characters
- From: Marco Mariani <marco@xxxxxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 13:38:38 +0200
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'
>>>
.
- Follow-Ups:
- Re: computing with characters
- From: Terry Reedy
- Re: computing with characters
- From: Torsten Bronger
- Re: computing with characters
- References:
- computing with characters
- From: SL
- Re: computing with characters
- From: Lutz Horn
- Re: computing with characters
- From: SL
- Re: computing with characters
- From: Gabriel Genellina
- Re: computing with characters
- From: SL
- Re: computing with characters
- From: Torsten Bronger
- Re: computing with characters
- From: Duncan Booth
- Re: computing with characters
- From: Torsten Bronger
- computing with characters
- Prev by Date: Re: computing with characters
- Next by Date: Re: computing with characters
- Previous by thread: Re: computing with characters
- Next by thread: Re: computing with characters
- Index(es):
Relevant Pages
|