Re: [Python-Dev] partition() variants

2006-05-26 Thread Guido van Rossum
I think you're getting to implementation details here. Whether a new string is returned or a reference to the old one is an optimization decision. I don't think it's worth legislating this behavior one way or another (especially since it's mostly a theoretical issue). --Guido On 5/26/06, Walter D

Re: [Python-Dev] partition() variants

2006-05-26 Thread Walter Dörwald
Guido van Rossum wrote: > On 5/26/06, Walter Dörwald <[EMAIL PROTECTED]> wrote: > [...] >> And what happens if the separator is an instance of a subclass? >> >> class s2(str): >> def __repr__(self): >> return "s2(%r)" % str(self) >> >> print "foobar".partition(s2("o")) >> >> Currently t

Re: [Python-Dev] partition() variants

2006-05-26 Thread Fredrik Lundh
Raymond Hettinger wrote: > 1) Is str.rpartition() still wanted? > > Yes. I might have missed my earlier 30-minute deadline with one minute (not my fault! I was distracted! seriously!), but this time, I actually managed to get the code in there *before* I saw the pronouncement ;-) _

Re: [Python-Dev] partition() variants

2006-05-26 Thread Raymond Hettinger
> 1) Is str.rpartition() still wanted? Yes. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] partition() variants

2006-05-26 Thread Guido van Rossum
On 5/26/06, Walter Dörwald <[EMAIL PROTECTED]> wrote: > A.M. Kuchling wrote: > > > I didn't find an answer in the str.partition() thread in the archives > > (it's enormous, so easy to miss the right message), so I have two > > questions: > > > > 1) Is str.rpartition() still wanted? Can't remember.

Re: [Python-Dev] partition() variants

2006-05-26 Thread Walter Dörwald
A.M. Kuchling wrote: > I didn't find an answer in the str.partition() thread in the archives > (it's enormous, so easy to miss the right message), so I have two > questions: > > 1) Is str.rpartition() still wanted? > > 2) What about adding partition() to the re module? And what happens if the s

[Python-Dev] partition() variants

2006-05-26 Thread A.M. Kuchling
I didn't find an answer in the str.partition() thread in the archives (it's enormous, so easy to miss the right message), so I have two questions: 1) Is str.rpartition() still wanted? 2) What about adding partition() to the re module? --amk ___ Python