Class Variable Question
Douglas Alan
nessus at mit.edu
Mon Apr 9 13:34:49 EDT 2001
"Steve Holden" <sholden at holdenweb.com> writes:
> That's correct. Python gives you "enough rope to shoot yourself in
> the foot", and so does not offer the protection schemes associated
> with statically-types languages like Java and C++. This increases
> the flexibility of the language, at the (slight) risk of errors
> which would not occur in Java or C++.
Actually, there's no extra flexibility than if you used different
syntaxes for variable initialization and variable assignment.
> There is magic you can do to restrict operations of this kind, but most
> Python programmers are happy to accept the language as it is, since in
> practise this doesn't appear to be a problem.
In practice it is a *very* significant problem. This is certainly one
of the largest sources of bugs. And it is, annoyingly enough, one of
the few valid complaints that Perl devotees can make against Python.
> Look at it this way: you can spend the 60% time saving you will make
> by programming in Python to make sure you have not made such errors!
Why not be honest: It's a wart on the language. But no language is
perfect and Python is far better than most.
|>oug
More information about the Python-list
mailing list