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: Thu, 10 Mar 2016 12:28:55 +1100 Lines: 42 Message-ID: References: <56df6761$0$1588$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de ciyy7TyJXfblONYVDIg57Qv/L6zgwxUkTkT7XlEwzFKg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'anyway.': 0.04; 'bytes.': 0.07; 'character,': 0.07; 'pretend': 0.07; 'cc:addr:python-list': 0.09; '"but': 0.09; '16-bit': 0.09; 'byte,': 0.09; 'encoding.': 0.09; 'seen,': 0.09; 'subject:which': 0.09; 'yeah,': 0.09; 'encoding': 0.15; 'thu,': 0.15; '2016': 0.16; 'buggy': 0.16; 'costs.': 0.16; 'count,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'involved;': 0.16; 'pity': 0.16; 'received:209.85.213.176': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'restricting': 0.16; 'set,': 0.16; 'unicode.': 0.16; 'utterly': 0.16; 'wrote:': 0.16; 'memory': 0.17; 'string': 0.17; 'byte': 0.18; 'integer': 0.18; 'typical': 0.18; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '(the': 0.22; "aren't": 0.22; 'ascii': 0.22; 'assumes': 0.22; 'pascal': 0.22; 'am,': 0.23; 'code,': 0.23; 'code.': 0.23; 'written': 0.24; 'header:In-Reply-To:1': 0.24; 'signed': 0.24; "i've": 0.25; 'followed': 0.27; 'message-id:@mail.gmail.com': 0.27; 'specifically': 0.28; 'this.': 0.28; 'sure,': 0.29; 'array': 0.29; 'character': 0.29; "i'm": 0.30; 'work.': 0.30; 'code': 0.30; 'probably': 0.31; 'anyone': 0.32; "can't": 0.32; '[1]': 0.32; 'computing': 0.32; 'getting': 0.33; 'stream': 0.33; "i'll": 0.33; 'except': 0.34; 'that,': 0.34; 'list': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'text': 0.35; 'unicode': 0.35; 'knowledge': 0.35; 'comment': 0.35; "isn't": 0.35; 'but': 0.36; 'there': 0.36; 'received:209.85': 0.36; '(and': 0.36; "wasn't": 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'doing': 0.38; 'received:209': 0.38; 'wrong': 0.38; 'someone': 0.38; 'or,': 0.38; 'speak': 0.38; 'means': 0.39; 'where': 0.40; 'still': 0.40; 'software': 0.40; 'your': 0.60; "you'll": 0.61; 'ago.': 0.61; 'back': 0.62; 'per': 0.62; 'you.': 0.64; 'mar': 0.65; 'today': 0.65; 'complement': 0.66; 'real-world': 0.66; 'remember,': 0.66; '1990s,': 0.84; 'alright,': 0.84; 'chrisa': 0.84; 'coherent': 0.84; "else's": 0.84; 'to:none': 0.91; '"one': 0.91; 'minute.': 0.91; 'have.': 0.93 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=VB/z+2QNwDK6tK75eheux6rgnSQ7vzH7rCKIug0C/lQ=; b=AGp22XX8ZrTzREE744T3uzvzqqvIxGm/IPkp1Wga2Zq0axAUONaC+HBZzk/xgz1Eri ArCBFoa1aRIY6xAs/hhY24xl3jTFIr5Vzdt2Whzmfo7JFlU5Kgybvkj3ErqyPbdqpmhF j2Icwu0XaNutBETpaA0WN12ZC3IXJxpE3ADaYQEwu5+mRfu3xYMUcmeRK70FLn8YAPIt EFirqYAuvkZAINVfWDL2HjXMg5j0L5Jrdl2895j0YihX9/S1TrkbD/f5d7dB2e/2YMzE uIxnQOAgW0yPdDmLye2dwt+fpZIQSzWjqYi4uZVXwOtA9tYwAjcQcucOrd/zpU6vewd5 TCpw== 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=VB/z+2QNwDK6tK75eheux6rgnSQ7vzH7rCKIug0C/lQ=; b=jESWcsh17q6Lnt6Z1D4yh+I5onRiQRuPZwI8UY1C3s1fNd6M8CXvUD2vOkTN1daUHh UJnuIEg1+b1bpK7TfIghwrM3VUa+NyCXiW6Ibb7+4Dz6J/PnRBBsbseqE0pNNWiBL5aj AmotXeLc2BDZunxu4Z12erdSVEdNRkEmmr+Di0zuw9ZJPRf8DhBWEJ6C4CJcuJFQ7D5n sSE8AzFSexsjCbGWCgP/Fa5eFEgqWt5o1LPCAR9z9CRp69FPanM2R6b/NQn2SGW47Lwr ie0rjxoaulxMDfC9UlKzA+ZQPcylBsXr03mxtOmwBzltSrJuMbpg+Plo42I/1U8Iuwe3 7ZfQ== X-Gm-Message-State: AD7BkJK68GPDNgVw86TQdYMEQPnc3DqoQiRRsBSYp9DTDSTpmq2BSSY7J2jnN+tyksMvebDFCCeqCrDK9SNaSw== X-Received: by 10.50.28.105 with SMTP id a9mr885384igh.94.1457573335793; Wed, 09 Mar 2016 17:28:55 -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:104463 On Thu, Mar 10, 2016 at 11:58 AM, BartC wrote: >>> I'm not much interested in Unicode at the minute. I'll pass. > > >> Your final comment sums up perfectly your knowledge of computing in >> 2016. > > > You're utterly determined to belittle everything I do aren't you! > > But, yeah, I was writing international applications decades ago. I'm not > working for anyone now and don't need to bother. > > From what I've seen, a lot of software can't get it right anyway. That would be because a lot of software is written by people who don't understand Unicode. "But other people get it wrong too!" wasn't a valid excuse when I was in grade school, and it still isn't in real-world work. [1] If you are writing code in 2016 that assumes that a byte is the same thing as a character, and speak as if this is alright, then yes, we WILL belittle you for it. It's on par with thinking that an integer is a 16-bit signed two's complement number. Sure, back in the 1990s, you could probably get away with that (and you'll find a lot of games that flip at 32,767 or 65,535 - or, in one that I remember, at 3,276,700!), but nobody today would let you pretend that those are identical. Neither is a list identical to a coherent block of memory (the way a C array often is implemented) - and neither is a text string identical to a stream of bytes. Even if you're restricting your text to the ASCII set, there is still an encoding involved; a typical C string's encoding is "one character per byte, followed by 0x00", whereas a Pascal string's encoding might be "one character per byte, preceded by the character count, represented in a single byte". Every encoding has consequences, every encoding has costs. You can't get away from this. You can't pretend that you don't have an encoding. ChrisA [1] Except when you're specifically writing compatibility code, where getting it identically wrong means your program successfully interoperates with someone else's buggy code. But if you're doing that, I pity you. That is not a fun job to have.