[Tutor] declarations
Pijus Virketis
virketis@fas.harvard.edu
Sun, 7 Apr 2002 19:13:17 -0400
<HTML><HEAD>
<BASEFONT FACE=3D"Arial" SIZE=3D"2" COLOR=3D"#000000">
</HEAD>
<BODY>
<div>Cameron,<br></div>
<div> </div>
<div>I am definitely not an expert on the deep issues of typing,=
because I have not done much with static type languages, and in=
Python potential pitfalls are usually notable only by their=
absence ... :) But the only area where advance typing is useful=
in my experience is when you want to take advantage of some=
method unique to a given type. Example:<br></div>
<div> </div>
<div>list =3D [] # I have to make sure Python=
knows this will be a list<br></div>
<div>list.append("a") <br></div>
<div> </div>
<div>There is little real advantage of saying "variable =3D=
0" at the top of the program, because it seems to me there=
is nothing preventing you from assigning a string to this=
"variable" twenty lines down in Python. Or maybe I am=
just missing the point ... :)<br></div>
<div> </div>
<div>Cheers, <br></div>
<div> </div>
<div>Pijus<br></div>
<div>-- <br></div>
<div>All bad precedents began as justifiable measures. -- Gaius=
Julius Caesar, quoted in "The Conspiracy of Catiline",=
by Sallust <br></div>
</body></html>