Re: Mutable Strings - Any libraries that offer this?

2009-07-26 Thread Jack Diederich
On Mon, Jul 20, 2009 at 5:57 AM, casebash wrote: > Hi, > > I have searched this list and found out that Python doesn't have a > mutable string class (it had an inefficient one, but this was removed > in 3.0). Are there any libraries outside the core that offer this? It depends on how mutable you w

Re: Mutable Strings - Any libraries that offer this?

2009-07-26 Thread Neil Hodgson
Mark Lawrence: > If my sleuthing is correct the problem is with these lines > > ilow *= self->itemSize; > ihigh *= self->itemSize; > > in GapBuffer_slice being computed before ilow and ihigh are compared to > anything. This particular bug was because ihigh is the maximum 32 bit integer 21474

Re: Mutable Strings - Any libraries that offer this?

2009-07-26 Thread Mark Lawrence
Neil Hodgson wrote: casebash: I have searched this list and found out that Python doesn't have a mutable string class (it had an inefficient one, but this was removed in 3.0). Are there any libraries outside the core that offer this? I wrote a gap buffer implementation for Python 2.5 allow

Re: Mutable Strings - Any libraries that offer this?

2009-07-22 Thread casebash
Thanks all for your advice. I'm not actually going to use the mutable string right at the moment, but I thought I might in the future and I was just curious if it existed. I suppose a list of characters is close enough for most purposes. On Jul 22, 10:28 am, greg wrote: > Ben Finney wrote: > > My

Re: Mutable Strings - Any libraries that offer this?

2009-07-21 Thread greg
Ben Finney wrote: My point was rather meant to imply that subclassing the built-in (immutable) string types was the best way to usefully get all their functionality However, it would be difficult to do that without changing all C code that deals with strings, including that in extension modules

Re: Mutable Strings - Any libraries that offer this?

2009-07-21 Thread Scott David Daniels
Steven D'Aprano wrote: On Mon, 20 Jul 2009 21:08:22 +1000, Ben Finney wrote: What is it you're trying to do that makes you search for a mutable string type? It's likely that a better approach can be found. When dealing with very large strings, it is wasteful to have to duplicate the entire st

Re: Mutable Strings - Any libraries that offer this?

2009-07-21 Thread Ben Finney
Steven D'Aprano writes: > On Mon, 20 Jul 2009 21:08:22 +1000, Ben Finney wrote: > > A mutable string would not (AFAICT) be usefully implementable as a > > subclass of the built-in string types. So even if such a type > > existed, it would not be useable with all the functionality that > > works w

Re: Mutable Strings - Any libraries that offer this?

2009-07-21 Thread Ben Finney
John Machin writes: > OK, I'll bite: where does the Python 3.x bytearray type I wasn't previously aware of it, thanks for bringing it to my attention http://docs.python.org/3.1/library/stdtypes.html#bytes-methods>. > fit into your taxonomy? At first glance it appears to be mutable and > have a

Re: Mutable Strings - Any libraries that offer this?

2009-07-21 Thread Thomas Guettler
casebash schrieb: > Hi, > > I have searched this list and found out that Python doesn't have a > mutable string class (it had an inefficient one, but this was removed > in 3.0). Are there any libraries outside the core that offer this? Hi, you could use a list of characters. It would not be diff

Re: Mutable Strings - Any libraries that offer this?

2009-07-20 Thread Steven D'Aprano
On Mon, 20 Jul 2009 21:08:22 +1000, Ben Finney wrote: > casebash writes: > >> I have searched this list and found out that Python doesn't have a >> mutable string class (it had an inefficient one, but this was removed >> in 3.0). Are there any libraries outside the core that offer this? > > A m

Re: Mutable Strings - Any libraries that offer this?

2009-07-20 Thread Neil Hodgson
casebash: > I have searched this list and found out that Python doesn't have a > mutable string class (it had an inefficient one, but this was removed > in 3.0). Are there any libraries outside the core that offer this? I wrote a gap buffer implementation for Python 2.5 allowing character, uni

Re: Mutable Strings - Any libraries that offer this?

2009-07-20 Thread John Machin
On Jul 20, 9:08 pm, Ben Finney wrote: > casebash writes: > > I have searched this list and found out that Python doesn't have a > > mutable string class (it had an inefficient one, but this was removed > > in 3.0). Are there any libraries outside the core that offer this? > > A mutable string wou

Re: Mutable Strings - Any libraries that offer this?

2009-07-20 Thread Ben Finney
casebash writes: > I have searched this list and found out that Python doesn't have a > mutable string class (it had an inefficient one, but this was removed > in 3.0). Are there any libraries outside the core that offer this? A mutable string would not (AFAICT) be usefully implementable as a su

Re: Mutable Strings - Any libraries that offer this?

2009-07-20 Thread Carl Banks
On Jul 20, 2:57 am, casebash wrote: > Hi, > > I have searched this list and found out that Python doesn't have a > mutable string class (it had an inefficient one, but this was removed > in 3.0). Are there any libraries outside the core that offer this? I just did a brief search on Python Packagi

Mutable Strings - Any libraries that offer this?

2009-07-20 Thread casebash
Hi, I have searched this list and found out that Python doesn't have a mutable string class (it had an inefficient one, but this was removed in 3.0). Are there any libraries outside the core that offer this? Thanks, Chris -- http://mail.python.org/mailman/listinfo/python-list