[Python-Dev] Minidom and Unicode

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Sat, 1 Jul 2000 21:11:34 +0200

paul wrote:
> If we want to use a hard-coded lossless encoding, we should do so in
> repr. Rather than having us fix a dozen modules with problems like =
> we should fix repr once and for all.
how about allowing str and repr to actually return
unicode strings?

or in other words:

        PyObject *res;
        res =3D (*v->ob_type->tp_repr)(v);
        if (res =3D=3D NULL)
            return NULL;
        if (!PyString_Check(res) && !PyUnicode_Check(res)) {
                     "__repr__ returned non-string (type %.200s)",
            return NULL;
        return res;

(strings are strings are strings, etc)