Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #65556

Re: how to reduce bugs due to incorrect indentation

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <larry.martell@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'configure': 0.05; 'insert': 0.05; 'bug.': 0.09; 'exercising': 0.09; 'key.': 0.09; 'spaces': 0.09; 'python': 0.11; 'bug': 0.12; 'changes': 0.15; 'recently.': 0.16; 'tab': 0.16; 'tabs': 0.16; 'pushed': 0.16; 'appropriate': 0.16; 'wrote:': 0.18; 'looked': 0.18; 'commit': 0.19; 'thu,': 0.19; 'feb': 0.22; 'tests': 0.22; 'to:name :python-list@python.org': 0.22; 'error': 0.23; 'versions': 0.24; 'question': 0.24; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'along': 0.30; 'code': 0.31; 'lines': 0.31; 'accidentally': 0.31; 'file': 0.32; 'noticed': 0.34; 'problem': 0.35; 'something': 0.35; 'editor': 0.35; 'received:google.com': 0.35; 'should': 0.36; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'up,': 0.60; 'email addr:gmail.com': 0.63; 'show': 0.63; 'kind': 0.63; 'of:': 0.68; 'press': 0.70; 'therefore': 0.72; 'fortunately,': 0.84
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 :content-type; bh=mUIOWBD6X/RzTJ21aWoBO/F04ZzDa6gbsluQ045DUX0=; b=wAqKA3+MurAO5yroUPXIYyL6iey9bmACPY75sbu2MLSMub73VUEPa0FxaS0HWfjqBx iKDiVKDTJNyIx+8m2GyRVQHy9Ib/3td9NzuV9grpQNNQ2N6mh6dxSucOC0Wy3a0phmy9 LTaqq7JoCWGNGPNJmkf03qVoHexlhohBEUpotFy/JnoOGxmYUNq95CnRRGONS+vqDBFD A6SOTMWBNPcc3yQ+feIzHcVK8KK8DA8dKGJdwhK2IESfgXDpZrRUyLISvhI+hJoj8JZW ac5NrtW0MCZVWWF82tpnnYe4lCSIhvcUQQgHrf9Qb41oEkMt2N5/eILbwTdHclSQm9/V 4F3w==
MIME-Version 1.0
X-Received by 10.224.11.196 with SMTP id u4mr15881848qau.4.1391718990279; Thu, 06 Feb 2014 12:36:30 -0800 (PST)
In-Reply-To <ld0rb2$5od$1@ger.gmane.org>
References <f63f079f-da05-4f09-ad01-4b764ef16d7f@googlegroups.com> <ld0rb2$5od$1@ger.gmane.org>
Date Thu, 6 Feb 2014 15:36:30 -0500
Subject Re: how to reduce bugs due to incorrect indentation
From Larry Martell <larry.martell@gmail.com>
To "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6458.1391719002.18130.python-list@python.org> (permalink)
Lines 33
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1391719002 news.xs4all.nl 2920 [2001:888:2000:d::a6]:41927
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65556

Show key headers only | View raw


On Thu, Feb 6, 2014 at 3:29 PM, Roel Schroeven <roel@roelschroeven.net> wrote:
> msustik@gmail.com schreef:
>>
>> 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'.
>>
>> My changes were elsewhere and I did not notice the above one line change
>> when I looked at the diffs before commit. I should have noticed it...
>>
>> It was rare that a was 1 and therefore the problem did not show up for a
>> while. (I know I should have had tests exercising all cases...)
>>
>> When the bug showed up, it was kind of difficult to remember what was the
>> original intent. Fortunately, looking at old versions allowed me to find the
>> problem commit and the bug.
>>
>> Any suggestion on how to avoid this type of error in the future?
>
>
> My suggestion: configure your editor to insert the appropriate amount of
> spaces instead of a tab when you press the tab key.

+1 - tabs are evil.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to reduce bugs due to incorrect indentation msustik@gmail.com - 2014-02-05 19:02 -0800
  Re: how to reduce bugs due to incorrect indentation Dan Sommers <dan@tombstonezero.net> - 2014-02-06 03:08 +0000
    Re: how to reduce bugs due to incorrect indentation Chris Angelico <rosuav@gmail.com> - 2014-02-06 15:47 +1100
  Re: how to reduce bugs due to incorrect indentation Asaf Las <roegltd@gmail.com> - 2014-02-05 21:23 -0800
  Re: how to reduce bugs due to incorrect indentation Terry Reedy <tjreedy@udel.edu> - 2014-02-06 03:09 -0500
  Re: how to reduce bugs due to incorrect indentation Grant Edwards <invalid@invalid.invalid> - 2014-02-06 14:49 +0000
    Re: how to reduce bugs due to incorrect indentation msustik@gmail.com - 2014-02-06 10:51 -0800
  Re: how to reduce bugs due to incorrect indentation Roel Schroeven <roel@roelschroeven.net> - 2014-02-06 21:29 +0100
    Re: how to reduce bugs due to incorrect indentation msustik@gmail.com - 2014-02-06 17:20 -0800
      Re: how to reduce bugs due to incorrect indentation Chris Angelico <rosuav@gmail.com> - 2014-02-07 12:57 +1100
      Re: how to reduce bugs due to incorrect indentation Roel Schroeven <roel@roelschroeven.net> - 2014-02-07 23:08 +0100
      Re: how to reduce bugs due to incorrect indentation Jurko Gospodnetić <jurko.gospodnetic@pke.hr> - 2014-02-08 12:11 +0100
  Re: how to reduce bugs due to incorrect indentation Larry Martell <larry.martell@gmail.com> - 2014-02-06 15:36 -0500
  Re: how to reduce bugs due to incorrect indentation Ethan Furman <ethan@stoneleaf.us> - 2014-02-06 13:32 -0800
  Re: how to reduce bugs due to incorrect indentation Larry Martell <larry.martell@gmail.com> - 2014-02-06 17:09 -0500
  Re: how to reduce bugs due to incorrect indentation Chris Angelico <rosuav@gmail.com> - 2014-02-07 09:30 +1100
    Re: how to reduce bugs due to incorrect indentation Asaf Las <roegltd@gmail.com> - 2014-02-06 15:01 -0800
      Re: how to reduce bugs due to incorrect indentation Chris Angelico <rosuav@gmail.com> - 2014-02-07 11:08 +1100
  Re: how to reduce bugs due to incorrect indentation Roel Schroeven <roel@roelschroeven.net> - 2014-02-07 23:06 +0100

csiph-web