[Discuss] Interpreters vs Compilers
Steven Kurylo
sk at infinitepigeons.org
Thu Mar 13 15:31:52 PDT 2008
> This is a very intriguing topic I only wish I new more about it. I can
> speculate however using the knowledge I have. A little knowledge can be
> a dangerous thing! I can use C and C++ fairly effectively after a few
> years of practice and I am studying Python to see if can be of use to my
> projects. One significant difference which may have a bearing on this
> topic is that C++ and Python handle polymorphism in different ways. C
> and C++ are strongly typed languages whereas Python automatically
> changes the type definition of variables according the objects they
> point to.
I'm not sure what you mean. Python is strongly typed. You can't add
an str to an int, even if the string is '1' and the int is '1'.
Though It is dynamically typed, you can put whatever type of data you
want into your variables. So you could assign a string to your
variable which used to have an int.
http://www.artima.com/weblogs/viewpost.jsp?thread=7590
> I can see that Python can provide me with some useful "glue" but as yet
> I am uncomfortable with having variables change there type without me
> necessarily being warned that they have.
I actually have had that happen in practice (some random module wasn't
giving me the type I was expecting, some of the time), its not
something that ever concerned me. Its usually a pretty easy fix, I
just test the variable near this corner case.
--
Steven Kurylo
More information about the Discuss
mailing list