Re: tuples, index method, Python's design
- From: Paul Rubin <http://phr.cx@xxxxxxxxxxxxxx>
- Date: 14 Apr 2007 10:59:42 -0700
"Rhamphoryncus" <rhamph@xxxxxxxxx> writes:
i = s.index(e) => s[i] = eIt never worked correctly on unicode strings anyway (which becomes the
Then this algorithm is no longer guaranteed to work with strings.
canonical string in python 3.0).
What?! Are you sure? That sounds broken to me.
Nope, it's pretty fundamental to working with text, unicode only being
an extreme example: there's a wide number of ways to break down a
chunk of text, making the odds of "e" being any particular one fairly
low. Python's unicode type only makes this slightly worse, not
promising any particular one is available.
I don't understand this. I thought that unicode was a character
coding system like ascii, except with an enormous character set
combined with a bunch of different algorithms for encoding unicode
strings as byte sequences. But I've thought of those algorithms
(UTF-8 and so forth) as basically being kludgy data compression
schemes, and unicode strings are still just sequences of code points.
.
- Follow-Ups:
- Re: tuples, index method, Python's design
- From: Rhamphoryncus
- Re: tuples, index method, Python's design
- References:
- Re: tuples, index method, Python's design
- From: Carsten Haese
- Re: tuples, index method, Python's design
- From: Paul Rubin
- Re: tuples, index method, Python's design
- From: Carsten Haese
- Re: tuples, index method, Python's design
- From: Antoon Pardon
- Re: tuples, index method, Python's design
- From: Duncan Booth
- Re: tuples, index method, Python's design
- From: Antoon Pardon
- Re: tuples, index method, Python's design
- From: Paul Boddie
- Re: tuples, index method, Python's design
- From: Terry Reedy
- Re: tuples, index method, Python's design
- From: Antoon Pardon
- Re: tuples, index method, Python's design
- From: Steve Holden
- Re: tuples, index method, Python's design
- From: Antoon Pardon
- Re: tuples, index method, Python's design
- From: Carsten Haese
- Re: tuples, index method, Python's design
- From: Antoon Pardon
- Re: tuples, index method, Python's design
- From: Rhamphoryncus
- Re: tuples, index method, Python's design
- From: Paul Rubin
- Re: tuples, index method, Python's design
- From: Rhamphoryncus
- Re: tuples, index method, Python's design
- Prev by Date: Re: "HTTP error -1" from urllib2
- Next by Date: Re: compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003
- Previous by thread: Re: tuples, index method, Python's design
- Next by thread: Re: tuples, index method, Python's design
- Index(es):
Relevant Pages
|