<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.2">
<TITLE>RE: dictionary initialization</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>[Caleb Hattingh]</FONT>
<BR><FONT SIZE=2>#- > (x not existing yet)</FONT>
<BR><FONT SIZE=2>#- > x+=1</FONT>
<BR><FONT SIZE=2>#- ></FONT>
<BR><FONT SIZE=2>#- > And have x = 1, while in Python you have to do</FONT>
<BR><FONT SIZE=2>#- ></FONT>
<BR><FONT SIZE=2>#- > (x not existing yet)</FONT>
<BR><FONT SIZE=2>#- > x=0</FONT>
<BR><FONT SIZE=2>#- > x+=1</FONT>
<BR><FONT SIZE=2>#- ></FONT>
<BR><FONT SIZE=2>#- > And then have x=1? Is this the question of debate here? </FONT>
<BR><FONT SIZE=2>#- One line of </FONT>
<BR><FONT SIZE=2>#- > initialisation to specify the type?</FONT>
</P>
<BR>
<P><FONT SIZE=2>[Dan Perl]</FONT>
</P>
<P><FONT SIZE=2>#- Yes, 2 lines instead of 1 is an issue. And it is not the </FONT>
<BR><FONT SIZE=2>#- only example where </FONT>
<BR><FONT SIZE=2>#- the "explicit is better than implicit" principle shows a </FONT>
<BR><FONT SIZE=2>#- downside. However, </FONT>
</P>
<P><FONT SIZE=2>You're missing a point. Remember that even dynamic typed, Python is strong typed.</FONT>
</P>
<P><FONT SIZE=2>If Python should deal with the user not binding the name to an object, what the type of that object should be?</FONT>
</P>
<P><FONT SIZE=2>Suppose I put:</FONT>
</P>
<P><FONT SIZE=2>>>> del x</FONT>
<BR><FONT SIZE=2>>>> x *= 5</FONT>
</P>
<P><FONT SIZE=2>x should be bound to an object of what type?</FONT>
</P>
<P><FONT SIZE=2>- 0 because x initialized to 0 by default and 0*5==0?</FONT>
<BR><FONT SIZE=2>- '' because x initialized to '' by default and ''*5==''?</FONT>
<BR><FONT SIZE=2>- [] because....</FONT>
</P>
<P><FONT SIZE=2>I think this is NOT a problem of explicit/implicit, is just a problem where Python can not guess what the user wants...</FONT>
</P>
<P><FONT SIZE=2>. Facundo</FONT>
</P>
</BODY>
</HTML>