Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: 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; 'received:209.85.212.46': 0.03; 'received:mail-vw0-f46.google.com': 0.03; 'wed,': 0.04; 'modified': 0.05; 'think,': 0.05; '3.2': 0.07; 'ascii': 0.07; 'terry': 0.07; 'tue': 0.07; 'python': 0.07; '>>>>': 0.09; 'bytes,': 0.09; 'str': 0.09; 'api': 0.11; 'pm,': 0.11; 'this:': 0.11; 'slightly': 0.12; 'am,': 0.14; 'wrote:': 0.14; 'subject:python': 0.15; '"copyright",': 0.16; '"credits"': 0.16; '"license"': 0.16; '9:31': 0.16; '[gcc': 0.16; 'earlier,': 0.16; 'linux2': 0.16; 'mrab': 0.16; 'reedy': 0.16; 'removal.': 0.16; 'type:': 0.16; '\xa0>>>': 0.16; '\xa0in': 0.16; 'traceback': 0.16; '(most': 0.16; 'bytes': 0.19; 'tue,': 0.20; 'cc:2**0': 0.20; 'header:In-Reply-To:1': 0.22; 'trying': 0.23; 'last):': 0.23; 'received:209.85.212': 0.25; 'suspect': 0.25; 'feb': 0.26; 'skip:b 20': 0.27; 'url:mailman': 0.27; 'fixed': 0.27; 'message- id:@mail.gmail.com': 0.28; "doesn't": 0.28; 'thanks.': 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; 'url:listinfo': 0.33; 'actually': 0.34; 'there': 0.35; 'file': 0.35; '"",': 0.35; 'function.': 0.35; 'problems': 0.37; 'some': 0.37; 'received:209.85': 0.37; 'url:python': 0.37; 'apr': 0.38; 'strings': 0.38; 'received:google.com': 0.38; 'but': 0.38; 'no.': 0.38; 'url:org': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'header:Received:5': 0.40; 'split': 0.60; 'back': 0.61; '2011': 0.62; 'kept': 0.73; '(unicode)': 0.84; '10:04': 0.84; 'cc:addr:python': 0.84; 'subject:better': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=jPkTbGBmivLkM+bxtvYWkrVmWICFmSaPT+Vq7ZO2JBg=; b=OAhnCbd6f8lF25iTPdVQ/drmhEUd1teb3ghLld4BBNy+dCD/XGLKtooljHHg+yK6vL ABNPNqD531kRE2faqmY7f6iu0Uw4LVflcbxZGEEeM3Yx41Xqacn5XW5JRmIZb2nuLeXa YwvTcOcaeLohWdh5sxIdiveoglotMcu592QcE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=VOeiUu+reGgqzVDNndPrS345Zyj6iO6kYJO2Ax4D2KtODmlXaIvBnPxdvUOuZjiAUb AqSVT0RvnUryFA1OvfNtgFgO0JoSTXJzYKR8rl8O5+lx5Q2nkF7scKvLA3ulFyRYyjtR hm3PJjcTa6rVr5MhASCexNQTHNmq6JoqNXJFw= MIME-Version: 1.0 In-Reply-To: <4D9C954C.4080401@mrabarnett.plus.com> References: <4d9b7eaa$0$10570$742ec2ed@news.sonic.net> <4D9C954C.4080401@mrabarnett.plus.com> Date: Wed, 6 Apr 2011 13:14:46 -0700 Subject: Re: is python 3 better than python 2? From: Dan Stromberg To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 48 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1302120891 news.xs4all.nl 41113 [::ffff:82.94.164.166]:51561 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2720 On Wed, Apr 6, 2011 at 9:31 AM, MRAB wrote: > On 06/04/2011 07:06, Dan Stromberg wrote: >> >> On Tue, Apr 5, 2011 at 10:04 PM, Terry Reedy > > wrote: >> >> =A0 =A0On 4/5/2011 4:42 PM, John Nagle wrote: >> >> =A0 =A0 =A0 =A0Well, actually Unicode support went in back around Python= 2.4. >> >> >> =A0 =A0Even earlier, I think, but there were and still are problems with >> =A0 =A0unicode in 2.x. Some were and will only be fixed in 3.x. >> >> >> =A0 =A0 =A0 =A0In 3.x, ASCII strings went away, but that was more of a r= emoval. >> >> >> =A0 =A0Yes and no. They were kept slightly modified as bytes, with all o= f >> =A0 =A0the 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. >> =A0>>> 'a/b/c'.split('/') >> ['a', 'b', 'c'] >> =A0>>> b'a/b/c'.split('/') >> Traceback (most recent call last): >> =A0 File "", line 1, in >> TypeError: Type str doesn't support the buffer API >> =A0>>> >> > 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'] > -- > http://mail.python.org/mailman/listinfo/python-list > Doh. Thanks. Now I can eliminate my my_split function. ^_^