Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: import locale and print range on same line Date: Sun, 24 Jan 2016 13:51:37 +1100 Lines: 20 Message-ID: References: <2bda88dd-82e3-4e43-b49c-3945a0befdc2@googlegroups.com> <56a37b1e$0$1612$c3e8da3$5496439d@news.astraweb.com> <56a383fa$0$1593$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de W+6/jbUxIXzNBIG6Y2cpyAxr+4vzPpbYPHlYcgiavCZQ== 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; 'received:209.85.223': 0.03; 'python3': 0.05; 'continuation': 0.07; 'cc:addr:python- list': 0.09; 'subject:same': 0.09; 'unexpected': 0.09; 'jan': 0.11; '(but': 0.15; '2016': 0.16; '24,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'preprocess': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'subject:import': 0.16; 'syntaxerror:': 0.16; 'wrote:': 0.16; 'string': 0.17; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'so.': 0.22; '"",': 0.22; 'second': 0.24; 'header:In-Reply-To:1': 0.24; 'parameters': 0.27; 'message-id:@mail.gmail.com': 0.27; '(it': 0.29; 'currently,': 0.29; 'character': 0.29; 'code': 0.30; 'maybe': 0.33; 'file': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'propose': 0.35; 'something': 0.35; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'does': 0.39; 'chrisa': 0.84; 'to:none': 0.91; 'technically': 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; bh=1UIk+AZClokeOIZl59WWy+QNAF2uGRmo+33oipu731w=; b=JeGG1gu7S5P7TL9PJZRzKHF9lfh/EnxB1W7ZJpUI02/EnpIydI1nE4jJc7hIdfDJi5 AFmyUBAJFh7VVnx+eIfkffmkXglnkZQdhVy9suTw2w2MkDiD7wBox6j0euK35F5vhWHc h0JK6zLv4eTzqhUQj5TUvzBFsKg6vgti5BPpZzAd54xUCNrkYTEIRoTo90J4+kE5bttE jmZPTM9QnwJhb8UY0ROUnMh7XtMDikH5oT5UTvI7NNuSHSaNRC0k2T+5pq7j4BM/pqNO 63lvHl0KyLfc1hhHlmU33RaL+1fAA6TQ1+n1us74yppGWg7eVdS4dtSk7YXSJ2SUN3AQ m1lA== 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:content-type; bh=1UIk+AZClokeOIZl59WWy+QNAF2uGRmo+33oipu731w=; b=b/smlEjcUlflTGo2RLE8aUj/wDNzI6eBOOLNTxbLfYa/0qHs2HCWNmhFLvzyVo/lbX hsWEPcDz2dyWLIh5Nfde8+IUV/HmPTEkkfuPJXFurex8Ja5MZ68A4VQtTFMcSVIToEuC aianFeP2PagZhjduTgKP/az1dj73Z6AJ6RKy6IXWlsfKt0PnVIe524jfgeymJd41qI3L nthupyTYm/aZpcZajFyi5vyAUK/+hZqnFRSiIFGiTqQ1g7p1AyH67gTFM4SlJNU+36ez 5rDd00pTiK24k/nvPU3CSNL0Oh3OtXIgRaKUu9A8rZY/F4+wKzLFkuR7cEtdK5p+swtt 4ZCg== X-Gm-Message-State: AG10YOSuZKeuvDjYpipoXU/V6wsrAFgCF9q/We5HUcGn1ucb3w+obtoWnMJrEWJw8A94QivnAwCXVyxMVD+WKA== X-Received: by 10.107.47.162 with SMTP id v34mr10049484iov.19.1453603897915; Sat, 23 Jan 2016 18:51:37 -0800 (PST) In-Reply-To: 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: , Xref: csiph.com comp.lang.python:102068 On Sun, Jan 24, 2016 at 1:45 PM, Terry Reedy wrote: > C:\Users\Terry>python -c "for i in range(5):\n\tprint('hello world')" > File "", line 1 > for i in range(5):\n print('hello world') > ^ > SyntaxError: unexpected character after line continuation character > > -c does not preprocess the code string before executing. I may propose that > it do so. As an alternative, maybe multiple -c parameters could result in multiple lines? Something like: python3 -c "for i in range(5):" -c " print('Hello, world')" Currently, a second -c is unparsed (it ends up in sys.argv), so this would technically be a behavioural change (but then, so would preprocessing). ChrisA