Python Feature Request: Explicit variable declarations

Paddy paddy3118 at googlemail.com
Sat Apr 14 06:32:18 EDT 2007


On Apr 14, 11:21 am, samj... at gmail.com wrote:
> Hello. Please tell me whether this feature request is sane (and not
> done before) for python so it can be posted to the python-dev mailing
> list. I should say first that I am not a professional programmer with
> too much technical knowledge.
>
> I would like to have something like the "option explicit" statement in
> Visual Basic which turns on C-like checking for declaration of
> variables. This is highly helpful for people who are coming from C/C+
> +, for people who are learning programming using Python, and even
> professionals, since this helps prevent typo errors like:
>
> sunlognitude = sunlongitude + 180.0
>
> where the user has inadvertantly typed "g" before "n" and will later
> wonder why his application is not working as expected.

Please read this:
http://www.python.org/doc/faq/programming.html#is-there-a-tool-to-help-find-bugs-or-perform-static-analysis

PyChecker and Pylint might help you.

- Paddy.




More information about the Python-list mailing list