Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Pyhon 2.x or 3.x, which is faster? Date: Tue, 8 Mar 2016 11:45:46 +1100 Lines: 15 Message-ID: References: <87d1r6iltx.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de WDCU+vhMwJSbHFJLyzMzKA9pGF7PJfVXjpA25BU2x6qg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'string.': 0.04; 'binary': 0.05; 'cc:addr:python-list': 0.09; '*is*': 0.09; 'subject:which': 0.09; 'python': 0.10; "'data'": 0.16; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'string': 0.17; 'byte': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'file:': 0.22; 'am,': 0.23; 'code,': 0.23; 'header:In-Reply-To:1': 0.24; 'sort': 0.25; 'message- id:@mail.gmail.com': 0.27; 'received:209.85.213.174': 0.29; 'array': 0.29; 'tue,': 0.34; 'file': 0.34; 'skip:d 20': 0.34; 'received:google.com': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'where': 0.40; 'still': 0.40; 'default': 0.61; 'mar': 0.65; '(is': 0.84; 'chrisa': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=JqGtn0ueBYQneBudAbYb9XZLZ0kqia4j3y88dCG/7i4=; b=IYh5tD2Hzl/qnHp9W/GmgtrFNKcdwVk9viF9KYlF50BSAFTQC9WlfveC/vLigXC/HO 8cLpIXyPhkglnl6B3nl6y/utKCEKfRq3YgeMnVvpnsFfT7jR4fH/jUFf5FErhgCynWZ7 fxUEOT08lfvNcDVBZQ+tDFEJFrUhwEQVfI8ck2OMuX8E2G4qrhvPLZQwdJQoTOuHPxn0 b+zAjjijcWYDzK7YEKbjF5rsLyLr5XALnzivf8c3JlEuS6o4lqfFaQbVxfEwpFwimlt9 CocEbVxBKd9a8R2BcBKziGeln6MzmmPh8Vm/dc9Aa1709F6R7qtRwgNmP9c0cBmDKrcZ zakQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=JqGtn0ueBYQneBudAbYb9XZLZ0kqia4j3y88dCG/7i4=; b=YjMjNJ/9wabCPSBGF76NwmIhhI1E0IwBU7eN5sRmjoZLF9XUEF7cSPDlSk2o6Q1L1V nSzFHSoPoghNCImxjwPfFXkDSWbp1sxab84Jh81/r1GlLsX+bSQRwS1WJYPKebfVjMid dM8JDN+t3vKAWQQVdntm6sQ4ZCBZrEk/TbxvCqVc+t0ura7DsELDM582B5Uv5L+iONNy WPFO0cvhL5RWHMFX/41ET8KdfnFSK8tTiMOIa1V7Bf/cYwkkw/NPBhntLZ52Zrxw9l9B edHS7ILpCDqpi09idbGoF52ioJSpSJ9p2Cv4lSh8XVrBUpFkMCRHb+Ifi/DRmXqDqHus TyrA== X-Gm-Message-State: AD7BkJJwU6jypDl0FTqterYeHm73h7pwnMEUoGuIsHrUfKWiZrc8FqWRyrQnL4lV3emIhEOG9KYP2QWcZ7s9yQ== X-Received: by 10.50.137.35 with SMTP id qf3mr15683777igb.92.1457397946615; Mon, 07 Mar 2016 16:45:46 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:104286 On Tue, Mar 8, 2016 at 11:22 AM, BartC wrote: > > (Is a byte string the same as a byte array? Is a byte array the same as an > array.array? If I remove this line from my code, where 'data' has just been > read from a file: > > data=array.array('B',data) > > then it still works - Python 3. But not on Python 2. If I do .read on a > binary file I get a byte string in Python 3, but a string in Python 2. That > sort of mess. The default string in Py2 *is* a byte string. ChrisA