Python Feature Request: Explicit variable declarations

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Fri Apr 20 10:03:38 EDT 2007


samjnaa at gmail.com a écrit :
> 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.
> 

if you find declarative static typing programmer-friendly, then Python 
is definitively not for you, and you'd better look for something else 
(Java ?). FWIW, the first and main reason for stating typing is about 
compiler's hint and raw performances, not "type-safety".

(A professional programmer with restricted technical knowledge and 
absolutely no need for this kind of "help")



More information about the Python-list mailing list