Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #2709

Re: is python 3 better than python 2?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'modified': 0.05; 'think,': 0.05; '3.2': 0.07; 'ascii': 0.07; 'terry': 0.07; 'tue': 0.07; 'python': 0.07; 'bytes,': 0.09; 'from:addr:python': 0.09; 'str': 0.09; 'api': 0.11; 'pm,': 0.11; 'this:': 0.11; '>>>': 0.12; 'slightly': 0.12; 'wrote:': 0.14; 'subject:python': 0.15; '"copyright",': 0.16; '"credits"': 0.16; '"license"': 0.16; '[gcc': 0.16; 'earlier,': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:name:mrab': 0.16; 'linux2': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:84.92': 0.16; 'received:84.92.122': 0.16; 'received:84.92.122.60': 0.16; 'reedy': 0.16; 'removal.': 0.16; 'reply-to:addr:python-list': 0.16; 'type:': 0.16; 'traceback': 0.16; '(most': 0.16; 'bytes': 0.19; 'tue,': 0.20; 'header:In-Reply-To:1': 0.22; 'trying': 0.23; 'last):': 0.23; 'received:84': 0.25; 'suspect': 0.25; 'feb': 0.26; 'skip:b 20': 0.27; 'fixed': 0.27; "doesn't": 0.28; 'string': 0.29; 'subject:?': 0.29; 'unicode': 0.29; 'cmd': 0.31; 'typeerror:': 0.31; "skip:' 10": 0.32; 'to:addr:python-list': 0.32; 'actually': 0.34; 'there': 0.35; 'file': 0.35; 'header:User-Agent:1': 0.35; '"",': 0.35; 'reply-to:addr:python.org': 0.35; 'problems': 0.37; 'some': 0.37; 'apr': 0.38; 'strings': 0.38; 'but': 0.38; 'no.': 0.38; 'to:addr:python.org': 0.39; 'split': 0.60; 'back': 0.61; '2011': 0.62; 'reply-to:no real name:2**0': 0.72; 'header:Reply- To:1': 0.72; 'kept': 0.73; '(unicode)': 0.84; '10:04': 0.84; 'subject:better': 0.93
X-IronPort-Anti-Spam-Filtered true
X-IronPort-Anti-Spam-Result ApIIAGqUnE3Unw4S/2dsb2JhbACYbI0Md4h5uTOFbASRHw
Date Wed, 06 Apr 2011 17:31:08 +0100
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
MIME-Version 1.0
To python-list@python.org
Subject Re: is python 3 better than python 2?
References <mailman.42.1302007551.9059.python-list@python.org> <inf9vi$nvm$1@dont-email.me> <4d9b7eaa$0$10570$742ec2ed@news.sonic.net> <ings9q$qse$2@dough.gmane.org> <BANLkTi=waQzxrCfVhsnjB-Q5jnW7EJtpPA@mail.gmail.com>
In-Reply-To <BANLkTi=waQzxrCfVhsnjB-Q5jnW7EJtpPA@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To python-list@python.org
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.79.1302107467.9059.python-list@python.org> (permalink)
Lines 39
NNTP-Posting-Host 82.94.164.166
X-Trace 1302107467 news.xs4all.nl 81473 [::ffff:82.94.164.166]:47939
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:2709

Show key headers only | View raw


On 06/04/2011 07:06, Dan Stromberg wrote:
>
> On Tue, Apr 5, 2011 at 10:04 PM, Terry Reedy <tjreedy@udel.edu
> <mailto:tjreedy@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
>  >>>
>
You're trying to split bytes with a str (Unicode) argument. Try this:

 >>> b'a/b/c'.split(b'/')
[b'a', b'b', b'c']

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

is python 3 better than python 2? neil <neilharper300890@gmail.com> - 2011-04-05 13:42 +0100
  Re: is python 3 better than python 2? Mel <mwilson@the-wire.com> - 2011-04-05 14:46 +0000
    Re: is python 3 better than python 2? John Nagle <nagle@animats.com> - 2011-04-05 13:42 -0700
      Re: is python 3 better than python 2? Terry Reedy <tjreedy@udel.edu> - 2011-04-06 01:04 -0400
      Re: is python 3 better than python 2? MRAB <python@mrabarnett.plus.com> - 2011-04-06 17:31 +0100
      Re: is python 3 better than python 2? Terry Reedy <tjreedy@udel.edu> - 2011-04-06 13:01 -0400
      Re: is python 3 better than python 2? Dan Stromberg <drsalists@gmail.com> - 2011-04-06 13:14 -0700
  Re: is python 3 better than python 2? Gnarlodious <gnarlodious@gmail.com> - 2011-04-05 09:50 -0700

csiph-web