Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.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; 'python.': 0.02; 'causing': 0.04; 'syntax': 0.04; 'say,': 0.05; '"""': 0.07; 'contexts': 0.09; 'identifier': 0.09; 'cc:addr:python-list': 0.11; 'suggest': 0.14; 'mostly': 0.14; "wouldn't": 0.14; 'character.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'identifiers.': 0.16; 'roy': 0.16; 'subject:unicode': 0.16; 'suffixes': 0.16; 'url:courses': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'logical': 0.24; 'cc:2**0': 0.24; 'extension': 0.26; 'nearly': 0.26; 'least': 0.26; 'url:edu': 0.26; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'included': 0.31; 'code': 0.31; 'totally': 0.33; 'maybe': 0.34; "i'd": 0.34; "can't": 0.35; 'anywhere': 0.35; 'except': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'i.e.': 0.36; 'pm,': 0.38; 'rather': 0.38; 'problems.': 0.60; 'break': 0.61; 'first': 0.61; 'personal': 0.63; 'skip:n 10': 0.64; 'different': 0.65; 'alphanumeric': 0.68; 'smith': 0.68; 'as:': 0.81; 'characters,': 0.84; 'cobol': 0.84; 'confusing': 0.84; 'reading,': 0.84; 'to:none': 0.92 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=OTQP+GW5PHXc/gI8f5UpSDXS3c+c/j1dkYBLd6IeZQA=; b=R8G8+tkMY5Jpn85c/7QM1qwohj0/l6/AJut09KlJmzVooXXBtTiuIbkdAo76+kLC7E 7lR50JNnGN11uNVhQF7VsbuHtuSkXIUlSUYRL0HV8NyKKQDhq3X805drSYuBYYnnyqAX 8j0diVHVY0DGHPq1qCTRwQznlLObTiSD8p2TpFk8j1vHWByQwXwKZyUPR6lGai65n/Gf JgRDFLbOwf20IxlWppYhgV94diDBhl0e/AlPw00e9cMRRwnH90zoW/ZgMmQOQBUUck+c xaXXLeMTsujq5G0p5fx+ZTK80M32E7MhnczG6TiDmwAuLc9+bpHe8JWRAmoHFYKx9ESh cNSg== MIME-Version: 1.0 X-Received: by 10.68.200.74 with SMTP id jq10mr1396710pbc.169.1396357695058; Tue, 01 Apr 2014 06:08:15 -0700 (PDT) In-Reply-To: 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> <533A768F.5080102@rece.vub.ac.be> <533A96E9.1030107@rece.vub.ac.be> Date: Wed, 2 Apr 2014 00:08:14 +1100 Subject: Re: unicode as valid naming symbols 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: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1396357704 news.xs4all.nl 2926 [2001:888:2000:d::a6]:37663 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69510 On Tue, Apr 1, 2014 at 11:29 PM, Roy Smith wrote: >> But I confess that is mostly personal taste, since I find names_like_this >> ugly. Names-like-this look better to me but that wouldn't be workable >> in python. But maybe there is some connector that would be aestetically >> pleasing and not causing other problems. > > Semi-seriously, let me suggest (names like this). It's not valid syntax > now, so it can't break any existing code. It reuses existing > punctuation in a way which is a logical extension of its traditional > meaning, i.e. "group these things together". I'd really rather not have a drastically different concept of "name" to every other language's definition! Reading over COBOL code is confusing in ways that reading, say, Ruby code isn't; the ? and ! suffixes aren't nearly as confusing as: http://www.math-cs.gordon.edu/courses/cs323/COBOL/cobol.html """ COBOL identifers are 1-30 alphanumeric characters, at least one of which must be non-numeric. In certain contexts it is permissible to use a totally numeric identifier; however, that usage is discouraged. Hyphens may be included in an identifier anywhere except the first of last character. """ Hyphens in names! Ugh! That means subtraction! :) But there is a solution! You can have *anything you want* in your identifiers. Watch: v = {} v["names like this"] = 42 print(v["names like this"]) Yes, that's a five-character delimiter/marker. But it works!! ChrisA