[Python-Dev] [1.6]: UserList, Dict: Do we need a UserString class? (original) (raw)

Moshe Zadka Moshe Zadka mzadka@geocities.com
Wed, 29 Mar 2000 11:59:47 +0200 (IST)


On Wed, 29 Mar 2000, Peter Funk wrote:

Hi!

Moshe Zadka: > eagerly-waiting-for-UserString.py-ly y'rs, Z. Well, I've added the missing methods. Unfortunately I ran out of time now and a 'testuserstring.py' derived from 'src/Lib/test/teststring.py' is still missing.

Great work, Peter! I really like UserString. However, I have two issues with MutableString:

  1. I tshouldn't share implementation with UserString, otherwise your algorithm are not behaving with correct big-O properties. It should probably use a char-array (from the array module) as the internal representation.

  2. It shouldn't share interface iwth UserString, since it doesn't have a proper implementation with hash.

All in all, I probably disagree with making MutableString a subclass of UserString. If I have time later today, I'm hoping to be able to make my own MutableString