<div dir="ltr">On 25 February 2013 00:08,  <span dir="ltr"><<a href="mailto:piterrr.dolinski@gmail.com" target="_blank">piterrr.dolinski@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">> For example (I believe it's already been mentioned) "declaring" intX with some integer value does *nothing* to maintain<br>


><br>
> X as an integer:<br>
><br>
> --> intX = 32<br>
><br>
> --> intX = intX / 3.0<br>
><br>
> --> intX<br>
><br>
> 10.6666666666<br>
><br>
<br>
</div>Yes I did see that it is possible to redefine the type of a variable. But I don't think I would ever do this intentionally; need to be really careful with Python.</blockquote><div><br></div><div style>Not necessarily.</div>

<div style><br></div><div style>Python duck types. If you don't know what that means, Google's got a ton on it.</div><div style><br></div><div style>Take a look at my really bad quadratic equation solver. It supports integer input, float input and complex input. It will output a list of two floats or complex numbers.</div>

<div style><br></div><div style>That's a use for having one variable have different types. You'll find thousands of parallels in real, working code.</div><div style><br></div><div style>Hence, you don't really need to be careful. You'd probably benefit if you stopped thinking of supporting type-changing as "dangerous" and started thinking of it as "useful".</div>

</div></div></div>