[Python-Dev] Generalised String Coercion

M.-A. Lemburg mal at egenix.com
Mon Aug 8 18:51:47 CEST 2005

Guido van Rossum wrote:
> Ouch. Too much discussion to respond to it all. Please remember that
> in Jythin and IronPython, str and unicode are already synonyms. 

I know, but don't understand that argument: aren't we talking
about Python in general, not some particular implementation ?

Why should CPython applications break just to permit Jython and
IronPython applications not to break ?

> That's how Python 3.0 will do it, except unicode will disappear as being
> redundant. I like the bytes/frozenbytes pair idea. Streams could grow
> a getpos()/setpos() API pair that can be used for stateful encodings
> (although it sounds like seek()/tell() would be okay to use in most
> cases as long as you read in units of whole lines). 

Please don't confuse the raw bytes position in a file or stream
with e.g. an index into the possibly decoded data. Those are
two different pairs of shoes.

Since the position into decoded data depends on what type of
encoding your using and how you decode, the "position" would
not be defined across streams, but depend on the features of
a particular stream.

> For sockets, send()/recv() would deal in bytes, and makefile() would get an
> encoding parameter. I'm not going to change my mind on text() unless
> someone explains what's so attractive about it.

Please read my reply for some reasoning and also Phillips
answer to your posting.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Aug 08 2005)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::

More information about the Python-Dev mailing list