That must be part of Pythons shiny ability of dynamic data types? Must be a messy operation to change data-types like that.. I think I'll just do my best to work with the right data-types the whole time ;D<br><br><div><span class="gmail_quote">
On 11/18/06, <b class="gmail_sendername">Alan Gauld</b> <<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
"Chris Hengge" <<a href="mailto:pyro9219@gmail.com">pyro9219@gmail.com</a>> wrote<br><br>> Not that it changes your reply, but just for my own sanity:<br>> int('7' * 10 ** 6) <- does this not just type-cast a char into an
<br>> int?<br><br>Chris, I suspect you may come from a C background?<br><br>Type *conversion* in Python is very differentb from<br>type *casting* in C.<br><br>type casting says take the binary data stored at x and treat
<br>it as a different type, thats pretty well instantaneous.<br><br>typecasting (int)'77' in C will not give you the number<br>77(decimal) but will give you the hex value 0x3737<br>which is entirely different (actually 14135!).
<br><br>Now typecasting in C++ is somewhat different, especially<br>if you use dynamic casts and that can involve converting<br>the type rather than just treating the existing data differently...<br>Because of this confusion over the word cast I prefer
<br>to refer to Python as doing type conversions.<br><br>Type conversion says take the data entity in variable x<br>and change its internal structure to the representation<br>of a new type. Thats a much more complex operation.
<br><br>HTH,<br><br>--<br>Alan Gauld<br>Author of the Learn to Program web site<br><a href="http://www.freenetpages.co.uk/hp/alan.gauld">http://www.freenetpages.co.uk/hp/alan.gauld</a><br><br><br>_______________________________________________
<br>Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br>