Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.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.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'else:': 0.03; 'subject:Python': 0.06; 'utf-8': 0.07; 'parsed': 0.09; 'reformat': 0.09; 'cc:addr:python-list': 0.11; 'code?': 0.16; 'fully,': 0.16; 'invalid.': 0.16; 'settings)': 0.16; 'true:': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'settings': 0.22; 'select': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'parse': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '15,': 0.26; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'code': 0.31; 'usually': 0.31; 'keys': 0.31; 'file': 0.32; 'url:python': 0.33; 'sense': 0.34; 'done.': 0.35; 'editor': 0.35; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'url:org': 0.36; 'should': 0.36; 'christian': 0.38; 'pm,': 0.38; 'though,': 0.39; 'url:mail': 0.40; 'how': 0.40; 'even': 0.60; 'from:charset:utf-8': 0.61; 'choose': 0.64; 'more': 0.64; 'forward': 0.65; 'skip:\xe2 10': 0.65; 'to:addr:gmail.com': 0.65; 'determine': 0.67; 'subject:there': 0.68; '8bit%:43': 0.74; "'true'": 0.84; 'placement': 0.84; 'why?': 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:to :cc:content-type:content-transfer-encoding; bh=IdtEjlZVh8GFXHLSXUXTGOEzm7lnvSkKXxqGnbuVkm4=; b=HlLdAk66tRVY/480zFk/RsskQqAYV8cJZBSt4lc6YYra15OVY3yvTfJSkl5BkKQxku 11K0/GiQnFPmN4blhpwJIi5vNyIr3bFjWTMwX/K5iD5+jIvkDn48aXwiPdNqYL6mjHd2 YEZSWp+If47Wri7jd/d6UHlVonfZJOhkOFV7r0YGDOGttXwya435/SVmzhbQ5kY0LlNP y53EVXdAmryG/AUgEx+WRBN0JBsx+Ln6GK+/f6Tnq3x8zo2qnL9eDr7Zlkt0kTcme4Gt uxTqL7IxNwiC7t7R40M2xErd16LVaWvUKumdh8x546XbIlWgNvAoLcbLbyFs4kKiK/04 0R2g== MIME-Version: 1.0 X-Received: by 10.107.134.75 with SMTP id i72mr3533911iod.53.1413383548969; Wed, 15 Oct 2014 07:32:28 -0700 (PDT) In-Reply-To: References: <9a0c67be-de3a-4770-bf06-e158783bfff0@googlegroups.com> Date: Wed, 15 Oct 2014 16:32:28 +0200 Subject: Re: Is there an easy way to control indents in Python From: =?UTF-8?B?Q2hyaXMg4oCcS3dwb2xza2HigJ0gV2Fycmljaw==?= To: alex23 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: 56 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1413383872 news.xs4all.nl 2833 [2001:888:2000:d::a6]:59141 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79148 On Wed, Oct 15, 2014 at 9:27 AM, alex23 wrote: > On 15/10/2014 12:23 PM, Juan Christian wrote: >> >> Using PyCharm is easy: >> >> File > Settings > (IDE Settings) Editor > Smart Keys > Reformat on paste >> > choose "Reformat Block" > > > > This isn't as straight forward as you imply. Say I have misindented code > like this: > > if True: > print 'true' > else: > print 'false' > print 'done' > > If I select this block in PyCharm and reformat it, I get: > > if True: > print 'true' > else: > print 'false' > print 'done' > > Which is still invalid. Even if it did work more fully, though, how would= it > determine the correct placement of the last line of code? > -- > https://mail.python.org/mailman/listinfo/python-list It should parse this as else: print 'false' print 'done' Why? Because things like `print 'done'` usually have an empty line before = it: if True: print 'true' else: print 'false' print 'done' That should be parsed the way you want it done. Makes perfect sense when you look at it. --=20 Chris =E2=80=9CKwpolska=E2=80=9D Warrick PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense