Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: how to reduce bugs due to incorrect indentation Date: Thu, 6 Feb 2014 14:49:54 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 24 Message-ID: References: NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1391698194 27775 64.122.56.22 (6 Feb 2014 14:49:54 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Thu, 6 Feb 2014 14:49:54 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:65542 On 2014-02-06, msustik@gmail.com wrote: > I had a bug in a Python script recently. The code in question was something along the lines of: > > if a == 1: > x = y > else: > x = z > y = z + y > z = z + 1 > > While editing this file I accidentally pushed TAB on the line > with 'y = z + y'. > > Any suggestion on how to avoid this type of error in the future? The best advice is to pay closer attention to what you're doing. Look at the code while you're editing, not your fingers. Before you commit the change, spend some time looking carefully at it to verify that changes were intentional. -- Grant Edwards grant.b.edwards Yow! I left my WALLET in at the BATHROOM!! gmail.com