[Python-3000] py3k conversion docs?

Guido van Rossum guido at python.org
Sat Aug 4 23:48:47 CEST 2007


I haven't seen the patch you mention, and unfortunately there aren't
docs for the conversion yet.

However, one thing to note is that in 2.x, the PyString type ('str')
is used for binary data, encoded text data, and decoded text data. In
3.0, binary and encoded text are represented using PyBytes ('bytes'),
and decoded text is represented as PyUnicode (now called 'str').
Perhaps it helps understanding the patch knowing that 'char*' is
likely encoded text, while 'PyUNICODE*' is likely decoded text.

Sorry,

--Guido

On 8/4/07, skip at pobox.com <skip at pobox.com> wrote:
> I'm looking at the recently submitted patch for the csv module and am
> scratching my head a bit trying to understand the code transformations.
> I've not looked at any py3k code yet, so this is all new to me.  Is there
> any documentation about the Py3k conversion?  I'm particularly interested in
> the string->unicode conversion.
>
> Here's one confusing conversion.  I see PyString_FromStringAndSize replaced
> by PyUnicode_FromUnicode.  In another place I see PyString_FromString
> replaced by PyUnicodeDecodeASCII.  In some places I see a char left alone.
> In other places I see it replaced by PyUNICODE.
>
> Skip
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org
>


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list