Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'string.': 0.05; 'explicit': 0.07; 'practice,': 0.07; 'string': 0.09; 'ambiguity': 0.09; 'delimited': 0.09; 'instance.': 0.09; 'subject:2.7': 0.09; 'whichever': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '2),': 0.16; '8-bit': 0.16; 'expects': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:unicode': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'code,': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'bytes': 0.24; 'unicode': 0.24; 'regardless': 0.24; 'cc:2**0': 0.24; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'array': 0.29; 'character': 0.29; 'message-id:@mail.gmail.com': 0.30; '25,': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'cases': 0.33; 'plain': 0.33; 'subject:time': 0.33; 'skip:d 20': 0.34; 'subject: (': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; 'subject:one': 0.36; 'being': 0.38; 'nov': 0.38; 'even': 0.60; 'skip:u 10': 0.60; 'full': 0.61; "you're": 0.61; 'subject:more': 0.64; 'talking': 0.65; 'apart': 0.72; 'genuine': 0.78; 'confusion.': 0.84; 'refuses': 0.84; 'to:none': 0.92; 'quotation': 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 :content-type; bh=yu6xG22Ux8zAqV8JhrY/5DCRzS1erXu3sBId1YzOiWY=; b=nrWme/Pnc4DM26QQWh2qPWvAumqN7W6AZYIKZQqUmLwSOVTihNXV/o5yviJAC1cJ+L B+TpyggTh3tSyZCCz2U6yROz6UehBVQnaELud2AhaB9waAEpzjVp8x3Lt6+qP1L6h8Xw 6RktXYXuRBHZFk2ebfMQPGf9UlDZT3aARahWU67q4OPCh2VSnhQDOW/F087IjGzNeVGl 5poZQR69cwskaKQsRzW0T5A2Sdr/aCJVRIg8rpdn2lN+CYQjr0e5psko37VSwiTK9Bfc EdL7xY3umLRjKtyA38tQJJ9y731M5zIoRe49wESI7GaqlYEqKObVY7Xdx4S9HQNyAYfV v7Pw== MIME-Version: 1.0 X-Received: by 10.50.62.104 with SMTP id x8mr8242075igr.2.1416870511928; Mon, 24 Nov 2014 15:08:31 -0800 (PST) In-Reply-To: <5473b781$0$12988$c3e8da3$5496439d@news.astraweb.com> References: <1416491999.209592.193345213.3A6FF9A4@webmail.messagingengine.com> <87ppch8zvx.fsf@elektro.pacujo.net> <87k32p6ow8.fsf@elektro.pacujo.net> <871towik8j.fsf@elektro.pacujo.net> <5470134c$0$12986$c3e8da3$5496439d@news.astraweb.com> <877fyn68m1.fsf@elektro.pacujo.net> <87sih913xe.fsf@elektro.pacujo.net> <87oarx11x8.fsf@elektro.pacujo.net> <5473b781$0$12988$c3e8da3$5496439d@news.astraweb.com> Date: Tue, 25 Nov 2014 10:08:31 +1100 Subject: Re: python 2.7 and unicode (one more time) From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416870521 news.xs4all.nl 2884 [2001:888:2000:d::a6]:49671 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81474 On Tue, Nov 25, 2014 at 9:56 AM, Steven D'Aprano wrote: > In all cases apart from an explicit "byte string", the word "string" is > always used for the native array-of-characters type delimited by plain > quotation marks, as used for error messages, user prompts, etc., regardless > whether the implementation is an array of 8-bit bytes (as used by Python > 2), or the full Unicode character set (as used by Python 3). So in > practice, provided you know which version of Python is being discussed, > there is never any genuine ambiguity when using the word "string" and no > excuse for confusion. And frequently, even if you're talking about Py2/Py3 cross code, there's still no ambiguity about the word "string": it means a default-for-the-language string. The locale.setlocale() function expects a string as its second parameter, for instance. (And unfortunately, flatly refuses the other sort, whichever way around that is.) ChrisA