[Python-Dev] strop vs. string
Tim Peters
tim.one@home.com
Sun, 27 May 2001 21:52:18 -0400
[Tim]
> About combining strop and buffers and strings, don't forget
> unicodeobject.c: that's got oodles of basically duplicate code too.
> /F suggested dealing with the minor differences via maintaining one
> code file that gets compiled multiple times w/ appropriate #defines.
[MAL]
> Hmm, that only saves us a few kB in source, but certainly not
> in the object files.
That's not the point. Manually duplicated code blocks always get out of
synch, as people fix bugs in, or enhance, one of them but don't even know
about the others. /F brought this up after I pissed away a few hours trying
to repair one of these in all places, and he noted that strop.replace() and
string.replace() are woefully inefficient anyway.
> The better idea would be making the types subclass from a generic
> abstract string object -- I just don't know how this will be
> possible with Guido's type patches. We'll just have to wait,
> I guess.
Wait for what? If it were possible, is the chance that you'd take time to
rework unicodeobject.c to "subclass from a generic abstract string object"
greater than 0? The chance that I would is exactly 0.