forcing variable declaration ??

Michael Chermside mcherm at mcherm.com
Tue May 27 14:11:43 EDT 2003


Axel Kowald writes:

> Is there a trick/feature/module that allows me to force 
> variable declaration in python?

Heiko Wundram replies:

> Use pychecker (http://pychecker.sourceforge.net)

Heiko has already given you the answer you need, but I thought I
would elaborate some. Your problem, as you described it, is not
that you need the compiler to be aware of the types of the variables
(which is what variable declarations are all about). Your REAL
problem is having typos, which turn up as bugs. That's why Heiko
suggests that you use pychecker. It is a tool which reads over your
code looking for typos and lots of other sorts of "bugs" - things
that might be syntactically correct (like misspelling a variable)
but are almost certainly wrong.

I agree with Heiko: pychecker will help you in lots of ways (not
just with typos).

-- Michael Chermside






More information about the Python-list mailing list