variable declaration

Paddy McCarthy paddy3118x at netscape.net
Thu Feb 3 16:58:01 EST 2005


Alexander Zatvornitskiy wrote:
> Hello All!
> 
> I'am novice in python, and I find one very bad thing (from my point of view) in
> language. There is no keyword or syntax to declare variable, like 'var' in
> Pascal, or special syntax in C. It can cause very ugly errors,like this:
> 
> epsilon=0
> S=0
> while epsilon<10:
>   S=S+epsilon
>   epselon=epsilon+1
> print S
> 
> It will print zero, and it is not easy to find such a bug!
> 
> Even Visual Basic have 'Option Explicit' keyword! May be, python also have such
> a feature, I just don't know about it?
> 
> Alexander, zatv at bk.ru
Advocates always say Type Checking, but so often it seems like Type 
Constriction. - To hell with it!
I don't believe I would be more productive by cluttering Python with the 
Type schemes and variable declarations found in languages like Pascal, 
C, Basic, C++ and Java.
People have said that there may be a more intelligent way, maybe type 
inferencing? But no, please, nothing like the above, it would just get 
in the way.

-- Paddy.



More information about the Python-list mailing list