Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "D'Arcy J.M. Cain" Newsgroups: comp.lang.python Subject: Re: Why not allow empty code blocks? Date: Fri, 29 Jul 2016 07:14:58 -0400 Organization: Vex.Net Lines: 32 Message-ID: References: <5792cd34$0$1587$c3e8da3$5496439d@news.astraweb.com> <87vazwppxx.fsf@elektro.pacujo.net> <579B1ABB.1070500@rece.vub.ac.be> <20160729071458.1dfa170f@imp> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de PlmQQ12bxenfBfLZEGwunANsZHWho7o3IfQ4Jte9pwAw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'debugging.': 0.07; 'subject:code': 0.07; 'cc:addr:python-list': 0.09; 'mentions': 0.09; 'simplified': 0.09; 'subject:Why': 0.09; 'subject:not': 0.11; '2016': 0.16; 'commented': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:allow': 0.16; 'wrote:': 0.16; 'debugging': 0.18; 'try:': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '+0200': 0.20; 'fairly': 0.22; 'pass': 0.22; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.24; 'example': 0.26; 'developers': 0.26; 'fri,': 0.27; 'really,': 0.29; 'too.': 0.30; 'code': 0.30; 'probably': 0.31; 'realize': 0.32; 'rule': 0.33; 'case,': 0.34; 'except': 0.34; 'something': 0.35; "isn't": 0.35; 'but': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'charset:us-ascii': 0.37; 'where': 0.40; 'some': 0.40; 'easy': 0.60; 'your': 0.60; 'programs': 0.62; 'more': 0.63; 'saving': 0.70; 'jul': 0.72; 'pardon': 0.84; 'premature': 0.84; 'received:98.158': 0.84 In-Reply-To: <579B1ABB.1070500@rece.vub.ac.be> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) 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: <20160729071458.1dfa170f@imp> X-Mailman-Original-References: <5792cd34$0$1587$c3e8da3$5496439d@news.astraweb.com> <87vazwppxx.fsf@elektro.pacujo.net> <579B1ABB.1070500@rece.vub.ac.be> Xref: csiph.com comp.lang.python:112012 On Fri, 29 Jul 2016 10:58:35 +0200 Antoon Pardon wrote: > As BartC already mentions it happens fairly often during debugging. > Something like. > > try: > Some code > except Some_Exception: > # Commented code for when I am debugging > pass I realize that that's a simplified example but really, isn't this just as easy? try: Some code # except Some_Exception: # Commented code for when I am debugging If your code block really is one line is "pass #" really so much more of a hardship than "#"? If it is a large block use "pass #@#" which is easy to remove with a search and replace. In any case, the rule about premature optimization for programs can probably be applied to developers too. Is saving a "pass" once in a while really where you need to focus your debugging efforts? -- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:darcy@Vex.Net VoIP: sip:darcy@Vex.Net