Re: computing with characters
- From: "Diez B. Roggisch" <deets@xxxxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 16:53:57 +0200
However, join() is really bizarre. The list rather than the
separator should be the leading actor.
Certainly *not*! This would be the way ruby does it, and IMHO it does not make sense to add join as a string-processing related method/functionality to a general purpose sequence type. And as others have pointed out, this would also mean that e.g.
def sgen():
for i in xrange(100):
yield str(i)
sgen.join(":")
wouldn't work or even further spread the join-functionality over even more objects.
An argument for the original ord/chr debate btw is orthogonality: if you want ord to be part of a string, you'd want chr to be part of ints - which leads to ugly code due to parsing problems:
(100).chr()
Diez
.
- Follow-Ups:
- 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: new free fiction
- Next by Date: Re: I messed up my wxPython install (Eclipse Configuration Issue)
- Previous by thread: Re: computing with characters
- Next by thread: Re: computing with characters
- Index(es):