[Edu-sig] [Fwd: typo.py - Warn of typographical errors in Python scripts]

L. Humbert humbert@hagen.de
Thu, 12 Jul 2001 21:30:27 +0200


This is a multi-part message in MIME format.
--------------858CE74DE3707D29EFC46ED1
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,
some of you, however, may get this message twice.
But I think, it is worth enough. 

	Ludger
--------------858CE74DE3707D29EFC46ED1
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Path: news.t-online.com!newsmm00.sul.t-online.com!newsfeed01.sul.t-online.de!t-online.de!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!zur.uu.net!ash.uu.net!news.baymountain.net!not-for-mail
From: "Alan Klietz" <alank@algintech.com>
Newsgroups: comp.lang.python.announce
Subject: typo.py - Warn of typographical errors in Python scripts
Date: Mon, 9 Jul 2001 11:55:06 -0500
Organization: Algin Technology
Approved: clpa-moderators@python.org
Message-ID: <mailman.994764060.20462.clpa-moderators@python.org>
NNTP-Posting-Host: mail.python.org
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Trace: news.baymountain.net 994764060 9562 63.102.49.29 (10 Jul 2001 11:21:00 GMT)
X-Complaints-To: abuse@baymountain.net
NNTP-Posting-Date: 10 Jul 2001 11:21:00 GMT
To: <clpa-moderators@python.org>
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Errors-To: clpa-moderators-admin@python.org
X-BeenThere: clpa-moderators@python.org
X-Mailman-Version: 2.0.5 (101270)
Precedence: bulk
List-Help: <mailto:clpa-moderators-request@python.org?subject=help>
List-Post: <mailto:clpa-moderators@python.org>
List-Subscribe: <http://mail.python.org/mailman/listinfo/clpa-moderators>,
	<mailto: clpa-moderators-request@python.org?subject=subscribe>
List-Id: <clpa-moderators.python.org>
List-Unsubscribe: <http://mail.python.org/mailman/listinfo/clpa-moderators>,
	<mailto: clpa-moderators-request@python.org?subject=unsubscribe>
Errors-To: clpa-moderators-admin@python.org
X-BeenThere: clpa-moderators@python.org
Xref: news.t-online.com comp.lang.python.announce:1314

One of the most common annoyances with using Python is that it does
not report typographical errors in variable names at compile time.

For example,

def compute_area(width, height):
    area = width * hieght   # oops

Another example is a typo in an attribute for a class,

class Square:
    def __init__(self, width, height):
        self.width = width
        self.hieght = height  # oops

    def compute_area(self):
        return self.width * self.height

typo.py will catch these errors and report them:

        hieght might be used before set at line 2
        self.height might be undefined at line 7

You can download typo.py from http://utools.com/typo.htm

Alan Klietz
Algin Technology
alank@algintech.NOSPAM.com




--------------858CE74DE3707D29EFC46ED1--