is python 3 better than python 2?

Dan Stromberg drsalists at gmail.com
Wed Apr 6 02:06:05 EDT 2011


On Tue, Apr 5, 2011 at 10:04 PM, Terry Reedy <tjreedy at udel.edu> wrote:

> On 4/5/2011 4:42 PM, John Nagle wrote:
>
>  Well, actually Unicode support went in back around Python 2.4.
>>
>
> Even earlier, I think, but there were and still are problems with unicode
> in 2.x. Some were and will only be fixed in 3.x.
>
>
>  In 3.x, ASCII strings went away, but that was more of a removal.
>>
>
> Yes and no. They were kept slightly modified as bytes, with all of the
> string methods kept.
>

I suspect not all string methods were kept for the bytes type:

$ /usr/local/cpython-3.2/bin/python
cmd started 2011 Tue Apr 05 11:05:08 PM
Python 3.2 (r32:88445, Feb 20 2011, 16:47:11)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 'a/b/c'.split('/')
['a', 'b', 'c']
>>> b'a/b/c'.split('/')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Type str doesn't support the buffer API
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110405/2ba324ba/attachment.html>


More information about the Python-list mailing list