[Zope-Coders] Re: [Zope-Checkins] CVS: Zope27/lib/python/TAL -
TALInterpreter.py:1.68.26.2
Florent Guillaume
fg@nuxeo.com
09 Sep 2002 19:03:07 +0200
On Mon, 2002-09-09 at 17:48, Guido van Rossum wrote:
> > This doesn't necessarily mean StringIO has to be changed, but rather
> > that those who call it have to ensure that they always pass the same
> > kind of strings to it.
>
> If you have that much control, why not use a simpe list and append()
> your Unicode strings to it? Then you can use "".join(L) to construct
> the final value.
I was just saying that, in the future, solving the Unicode problems will
mean taking care of a number of places where StringIO is called
indiscriminately today, and probably very little changes to StringIO
will be needed.
It really depends on the contract StringIO is fullfilling.
> StringIO is there (presumably) because you *haven't* got control, and
> you're depending on other code that calls write() on a file-like
> object.
Exactly. From a third-party app wanting to change Zope behavior I do not
have that much control. So have to resort to changes less pervasive than
fixing all the call sites, and overloading write() seems the easiest.
Florent
--
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com