Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2a.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; 'programmer': 0.03; 'operator': 0.03; 'english.': 0.04; 'argument': 0.05; 'abuse': 0.07; 'context': 0.07; 'damages': 0.07; 'expressions': 0.07; 'arguments': 0.09; 'ascii': 0.09; 'assuming': 0.09; 'comfortably': 0.09; 'decorator': 0.09; 'identifier': 0.09; 'meaningful': 0.09; 'noted,': 0.09; "wouldn't": 0.14; '(out': 0.16; 'comparison.': 0.16; 'exists,': 0.16; 'identifier,': 0.16; 'identifier.': 0.16; 'identifiers': 0.16; 'identifiers,': 0.16; 'non-ascii': 0.16; 'range.': 0.16; 'readability': 0.16; 'readable': 0.16; 'reedy': 0.16; 'restricting': 0.16; 'returned,': 0.16; 'scope.': 0.16; 'separated': 0.16; 'subject:unicode': 0.16; 'symbols': 0.16; 'syntactic': 0.16; 'syntax,': 0.16; 'unicode.': 0.16; 'worst': 0.16; 'wrote:': 0.18; 'module': 0.19; "python's": 0.19; 'fit': 0.20; 'written': 0.21; 'programming': 0.22; '31,': 0.24; "aren't": 0.24; 'certainly': 0.24; 'comparing': 0.24; 'decorators': 0.24; 'unicode': 0.24; 'mon,': 0.24; '(or': 0.24; 'question': 0.24; 'script': 0.25; 'first,': 0.26; 'second': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'rest': 0.29; 'character': 0.29; "doesn't": 0.30; 'characters': 0.30; 'message-id:@mail.gmail.com': 0.30; 'that.': 0.31; 'are.': 0.31; 'comparison': 0.31; 'context.': 0.31; 'noted': 0.31; 'second,': 0.31; 'symbolic': 0.31; 'view.': 0.31; 'this.': 0.32; 'probably': 0.32; "we're": 0.32; 'quite': 0.32; 'cases': 0.33; 'guess': 0.33; 'totally': 0.33; 'used,': 0.33; 'actual': 0.34; 'could': 0.34; 'problem': 0.35; "can't": 0.35; 'knows': 0.35; 'possible.': 0.35; 'anybody': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'consistent': 0.36; 'doing': 0.36; "didn't": 0.36; 'useful': 0.36; 'possible': 0.36; 'application': 0.37; 'easily': 0.37; 'being': 0.38; 'growing': 0.38; 'e.g.': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'anything': 0.39; 'expect': 0.39; 'though,': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'ian': 0.60; 'is.': 0.60; 'then,': 0.60; 'tell': 0.60; 'affect': 0.61; 'course': 0.61; 'first': 0.61; 'you.': 0.62; 'guarantee': 0.63; 'name': 0.63; 'such': 0.63; 'more': 0.64; 'different': 0.65; 'talking': 0.65; 'here': 0.66; 'mar': 0.68; 'yes': 0.68; 'alphanumeric': 0.68; 'incorporate': 0.68; 'line,': 0.68; '8bit%:96': 0.70; 'gain': 0.79; 'hardly': 0.84; 'improved.': 0.84; 'mare': 0.84; 'pardon': 0.84; 'prefers': 0.84; 'supporters.': 0.84; 'doubling': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=8yebh+2r5ncF0H+in6MI/MDKcHwiNlqHWQ2jOI/jQj4=; b=elB18cQ5ybDRy+JUCt5mhbVgT4j1+O+suhiJDXmBcynihQwRdjs5ClJw0dNI+ysKAq ZA7+V7nAjhw3RPi+EzAH8wuYMuXJN2QxfBYmBbcbUkagfhIaaBJ5w2/o4fXt7Io9UGQ+ /VNau0qW84+QQ6o+zeeByCknc8yoSiawlNlCD8+fyzDxiHCbKFdvADFd3nvbwh3mD6JB BqWOruaecbeQimkeUCk0Nkydqv89UiHHgBm9gAxD1BUNI72pkSwmSAF5rRFojkVXmYVC UhgvUbBiSGMyyNSL79FEAD1om0nwzcgY6f5eE2auhY2d9NVIK2o5AtFsxhqlHndhz4xp VMgw== X-Received: by 10.68.189.33 with SMTP id gf1mr11967655pbc.111.1396313308735; Mon, 31 Mar 2014 17:48:28 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <5339C281.7080300@rece.vub.ac.be> References: <5331D902.3030902@gmail.com> <53321819$0$29994$c3e8da3$5496439d@news.astraweb.com> <53393BA4.2080305@rece.vub.ac.be> <5339C281.7080300@rece.vub.ac.be> From: Ian Kelly Date: Mon, 31 Mar 2014 18:47:48 -0600 Subject: Re: unicode as valid naming symbols To: Python Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 95 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1396313312 news.xs4all.nl 2915 [2001:888:2000:d::a6]:50359 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69456 On Mon, Mar 31, 2014 at 1:31 PM, Antoon Pardon wrote: > Op 31-03-14 19:40, Ian Kelly schreef: >> That was an exaggeration on my part. It wouldn't affect my job, as I >> wouldn't expect to ever actually have to maintain anything like the >> above. My greater point though is that it damages Python's >> readability for no actual gain in my view. There is nothing useful >> you can do with a name that is the U+1F4A9 character that you can't do >> just as easily with alphanumeric identifiers like pile_of_poo (or >> =D0=BA=D1=83=D1=87=D0=B0_=D1=84=D0=B5=D0=BA=D0=B0=D0=BB=D0=B8=D0=B9 if o= ne prefers; that's auto-translated, so don't blame me >> if it's a poor translation). The kinds of symbols that we're talking >> about here aren't part of any writing systems, and so to incorporate >> them in *names* as if they were is an abuse of Unicode. > > Your argument doesn't has much weight. First of all it can be used > for just restricting names to the ascii range. I disagree. Non-ASCII written names are useful to anybody who prefers not to do all their programming in English. > Second of all I > think a good chosen symbolic name can be more readable than a > name in a character set you are not familiar with. A good chosen > symbol will evoke a meaning with a lot of people. A name in a > character set you are not familiar with is just gibberish to > you. Well, this is the path taken by APL. It has its supporters. It's not known for being readable. >> I don't think the comparisons to decorators and the if-else operator >> are apt. > > I didn't make such a comparison. I just noted the arguments against > were similar. That's the comparison to which I was referring. >> First, because while those may degrade readability, they do >> so in a constrained way. A decorator application is just the @ symbol >> and an identifier. > > And if abused, can totally change the working of your function. There > is no guarantee that the function returned, has any relation with the > original function. If that can't be a night mare for readability, > I don't know what is. As Terry Reedy noted, this has nothing to do with the decorator syntax, so it isn't much of an argument against having such syntax. >> The if-else is just three expressions separated by >> keywords. > > Yes but if used unrestrained in arbitrary expressions will make those > expressions hard to understand. I don't disagree. I hardly ever use it myself, certainly only if it can fit comfortably into one line, which is rare. But it's still quite limited in syntactic scope. >> In the case of arbitrary Unicode identifiers, we're talking >> about approximately doubling the number of different characters (out >> of a continuously growing set) that could be used, many of which are >> easily confused with other characters. Of course the potential for >> confusion already exists, but that's no justification for aggravating >> it. > > So what if we double the number of different characters? I don't care > about the number of them, I care about how meaningful they are. And > as you say confusion is already possible. A good programmer knows > how to deal with such a possible confusion, that the number of > cases increases, doesn't need to be a problem for those that care > about this. So tell me then, how would you deal with it? In the case of script identifiers, it's often not hard to discern from context whether a particular character is e.g. a Latin h or a Cyrillic =D2=BB. Assuming the original author wasn't being intentionally obfuscatory, if the rest of the identifier is Cyrillic then the character is probably also Cyrillic. If it's a one-character identifier, then hopefully the rest of the module is consistent and you can guess from that. If the identifier in question is just one symbol though, then you have a lot less context. > >> Second, at least in the case of decorators, while I don't dispute that >> they can harm readability, I think that in the majority of cases they >> actually help it. > > But that is not a fair comparison now, is it. What you are doing here > is comparing actual use, to a worst case doom scenario. I contend that there is no scenario with arbitrary Unicode identifiers where readability is improved.