strong/weak typing and pointers

Diez B. Roggisch deetsNOSPAM at web.de
Thu Oct 28 12:34:12 EDT 2004


> Is it correct to say that strong/weak typing does not make a difference
> if one does not use any pointers (or adress-taking operator)?

It seems that you mistake strong/weak typing with static/dynamic typing - a
completely different beast.

Python is in fact strong typed - in opposition to php or perl or even C,
this won't work:

a = "1" + 2

as "1" is a string and 2 an integer. And even though C is statically typed,
it won't complain - you just end up with an unexpected result.

And pointers are not evil in themselves - the are a neccessity to create
recursive structures. But deliberately casting pointers can be very harmful 
- a reason why its forbidden in languages like java and AFAIK ada.

> More concretely, I am thinking particularly of Python vs C++.
> So, are there any examples (without pointers, references, or
> adress-taking), which would have a different result in Python and in C++?

I have difficulties to understand what you want here. Please elaborate.

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list