Path: csiph.com!usenet.pasdenom.info!aioe.org!newsfeed1.swip.net!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!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.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'float': 0.05; 'cc:addr :python-list': 0.09; 'non-ascii': 0.09; 'subject:2.7': 0.09; 'python': 0.10; 'language,': 0.11; 'interpreter': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'literals': 0.16; 'subject:non': 0.16; 'wrote:': 0.16; 'tells': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'work,': 0.21; 'fine,': 0.22; 'header:In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; 'this.': 0.28; 'subject: [': 0.29; 'e.g.': 0.30; "d'aprano": 0.33; 'displayed': 0.33; 'int': 0.33; 'steven': 0.33; 'surprised': 0.33; 'received:google.com': 0.35; 'easiest': 0.35; 'but': 0.36; 'should': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'agree': 0.37; 'display': 0.37; 'setting': 0.37; "didn't": 0.39; 'enough': 0.39; 'subject:-': 0.39; 'build': 0.40; 'easy': 0.60; 'jul': 0.72; '8bit%:46': 0.76; '2:45': 0.84; 'actually,': 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 :content-type:content-transfer-encoding; bh=zRXhTe6WOd3m3ArGox/rRUe3b8k8cc5pbQeI4Awg0Mk=; b=Yi/e270P87r7W4gCCNnRZLv8gHTQwmYmWEKwBZKh913Ogbc2jgyiybf4ZuoJhfAEh4 iwwok06nS0YXmaFdQKLsDfmLMf9SOGbr3JEpKbX4baEFNZ/0JuAwA8fug7jprT4Jsh4j VHX//dYGrRQyvUlHrCVpQyWWwUIfpwK1oxwteIfPpA2S4ZkizQtBNTVBCIbdDU28RZBc f6e8Z1/FmZ+Kj1PmHY1JvWV/IkYKSua/HKrfufzEFto8gsk7vKhnB/DBfGIMAA7wi/UN H1oja761ROIHmutUzupfMZo+lhs5RN0fStqw3EEdnHkFiyTtizgErgx+n9ushvNu56ja oAvA== MIME-Version: 1.0 X-Received: by 10.50.134.196 with SMTP id pm4mr6168027igb.6.1437282409745; Sat, 18 Jul 2015 22:06:49 -0700 (PDT) In-Reply-To: <55ab2b57$0$1664$c3e8da3$5496439d@news.astraweb.com> References: <7083e494-6192-4acb-aea9-216d858171bc@googlegroups.com> <55ab2b57$0$1664$c3e8da3$5496439d@news.astraweb.com> Date: Sun, 19 Jul 2015 15:06:49 +1000 Subject: Re: Devanagari int literals [was Re: Should non-security 2.7 bugs be fixed?] From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1437282412 news.xs4all.nl 2837 [2001:888:2000:d::a6]:60613 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:94094 On Sun, Jul 19, 2015 at 2:45 PM, Steven D'Aprano wrot= e: > I think that Python should allow int and float literals using any sequenc= es > of digits from the same language, e.g. 12 or =E0=A5=A7=E0=A5=A8 but not = =E0=A5=A72. I would agree with this. Actually, given that int("=E0=A5=A7=E0=A5=A8") wor= ks just fine, I was surprised that it didn't already work in syntax. > One might have > an interpreter hook which displayed ints and floats using non-ASCII digit= s, > or one might even build that function into the intepreter, e.g. have a > global setting which tells ints and floats what digits to use, e.g.: > > sys.setdigits('Devanagari') Easiest way to play with this would be a sys.displayhook, I think; I suspect it would be problematic to change int.__str__ or int.__repr__. But for interactive work, yep, definitely, it should be easy enough to make int and float display appropriately. ChrisA