[Python-Dev] Alternative Implementation for PEP 292:SimpleString Substitutions

Barry Warsaw barry at python.org
Sat Sep 4 18:25:38 CEST 2004


On Fri, 2004-09-03 at 16:37, M.-A. Lemburg wrote:

> I think Barry needs some backup here.

Thanks MAL!

I'll point out that Template was very deliberately subclassed from
unicode, so Template instances /are/ unicode objects.  From the
standpoint of type conversion, using /F's notation, T(8) == U, thus
because U % 8 == U, T(8) % 8 == U.

Other than .encode() are there any other methods of unicode objects that
return 8bit strings?  I don't think so, so it seems completely natural
that T % 8 returns U.

Raymond is against the class-based implementation of PEP 292, but if you
accept the class implementation of 292 (which I still believe is the
right choice), then the fact that the mod operator always returns a
unicode makes perfect sense.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20040904/7a62acc7/attachment.pgp


More information about the Python-Dev mailing list