Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Why not allow empty code blocks? Date: Mon, 25 Jul 2016 00:51:02 +1000 Lines: 29 Message-ID: References: <5792cd34$0$1587$c3e8da3$5496439d@news.astraweb.com> <87vazwppxx.fsf@elektro.pacujo.net> <20160723082947.7cae8bd1@imp> <87fur0a44p.fsf@elektro.pacujo.net> <20160723095441.29562c54@imp> <57939373$0$1586$c3e8da3$5496439d@news.astraweb.com> <5794b1d7$0$1620$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de Y0M+a8uhydZ96BT/tnz5lgAp5oC8r2t0mJPDIz6MrK7w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'desk,': 0.05; 'subject:code': 0.07; 'cc:addr:python-list': 0.09; 'committing': 0.09; 'cursor': 0.09; 'subject:Why': 0.09; 'subject:not': 0.11; 'def': 0.13; 'commit': 0.15; '2016': 0.16; 'change;': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'mistake.': 0.16; 'pressed': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:allow': 0.16; 'undo': 0.16; 'wrote:': 0.16; 'changes': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'meant': 0.22; 'keys': 0.22; 'am,': 0.23; '(or': 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; "doesn't": 0.26; 'example': 0.26; 'coding': 0.27; 'not.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'accidentally': 0.29; 'code': 0.30; 'screen': 0.32; 'source': 0.33; 'control,': 0.33; 'skip:d 20': 0.34; 'received:google.com': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'doing': 0.38; 'delete': 0.38; 'sure': 0.39; 'where': 0.40; 'save': 0.60; 'your': 0.60; 'remember,': 0.66; 'jul': 0.72; 'attention': 0.76; 'chrisa': 0.84; 'happened.': 0.84; 'open,': 0.84; 'to:none': 0.91; 'glance': 0.91; 'shows,': 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:cc; bh=2Yo7iRme0nx/hVmJvx2idEY+JDDigRcMuPUZj7/h97g=; b=M6Bt2/eMbDvzuvMAR/078Kqmn7IBIcmnfV6MClikacDD+UJHZlkGxx42a9il17Ssoz pSkwAOCQg2uX9pEUaZvoODsDkzFcuLjEoVg7ckTo9P/IUTmwGSH1fy0kPf8T0KdbMB4s pxcXtDQRpcj7ZJ7QLUqPTpNGu7kK/wUaltZfx/8N/JcwBY/iy9kRUB0n4GbqutsJtBFu MWTHEt3i4XS253JklFd4+ftRHtJ8veIXh4CaRdizt8G5Ang8eOWKvAX8fE3Z5uHrupbS UINusC3IYLgCnROVkvk3fPHdelKtBN+KxSyT+5838Irejh293mqxs8nYPpOqt6aSmkoT ZUTQ== 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:from:date :message-id:subject:cc; bh=2Yo7iRme0nx/hVmJvx2idEY+JDDigRcMuPUZj7/h97g=; b=dJacMHJppf8iToToQqRcUsEFMbz0UYgQq7tZ6RwzVHaHSXd6B3su8vC4gLJh2FCQbM UK/ihFbjLld+TyCnp8bySbt94vwLdlFnOMAKhpopYF9zVk4pEPkhE6KBK9LviRg1NNCc mwpPwuEYifguyDd+he9Ivqtse4uswi54T5ZlLU5dtS564CvKG7BV4xH7PII7PAutCLLA LUrzI5N6eEj5UaThnHQAVQ7eC/pOpRLs+Y+J4hpKZENzBSZFobhF5hztO20yGwjLS8n8 znUL1GOaQy4t88Y559xuMNOoHr6gZtiAn5k8AoQwDC0Bkpxcbv8XpL/QJh9g/L9TEIma wYhQ== X-Gm-Message-State: AEkoousQpSU2lD0MoqaT8m5N/efmRg+R0zwRnF/6jiAbeoI1FCpHtrLwVKuZupf0Ubb4CM2uqpYiMeUIkPBDmA== X-Received: by 10.194.114.9 with SMTP id jc9mr10922638wjb.30.1469371863800; Sun, 24 Jul 2016 07:51:03 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <5792cd34$0$1587$c3e8da3$5496439d@news.astraweb.com> <87vazwppxx.fsf@elektro.pacujo.net> <20160723082947.7cae8bd1@imp> <87fur0a44p.fsf@elektro.pacujo.net> <20160723095441.29562c54@imp> <57939373$0$1586$c3e8da3$5496439d@news.astraweb.com> <5794b1d7$0$1620$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:111814 On Mon, Jul 25, 2016 at 12:44 AM, BartC wrote: > Your attention is diverted, you're doing something on your desk, but you hit > one of the keys by mistake. You might have pressed Delete or you might not. > You look at the screen which has a 5000-line program open, and you see this > (borrowing your example and with the cursor at "_"): > > def f(): > for x in seq: > do_this() > do_that() > _ do_more() > > Did you just unindent do_more(), or is that where it's meant to be? Undo may > or may not help (or it may undo something is needed). Undo, redo. See what happened. Easy. Also, if you're regularly committing to source control, you can always check the diff. Before you 'git commit', check what 'gitk' shows, or before 'hg commit', have a glance at 'hg diff'. Make sure what you're seeing is what you intend to change. Remember, code doesn't just accidentally change; everything should have purpose, including (especially) any indent/unindent. Source control protects you from everything other than multiple changes since the last commit. So commit often. It'll save you a lot of time - if not coding time, then debating-on-python-list time. :) ChrisA