variable declaration

Alexander Alexander_Zatvornitskiy at p131.f3.n5025.z2.fidonet.org
Sun Jan 30 23:40:38 EST 2005


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



More information about the Python-list mailing list