strong/weak typing and pointers

JCM joshway_without_spam at myway.com
Thu Oct 28 14:26:29 EDT 2004


Gabriel Zachmann <zach at cs.uni-bonn.de> wrote:

> 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)?

You'll find a lack of consensus here on what's meant by "strong/weak
typing".  In Python there's no way to re-interpret the bits of a value
as if they were a different type.  For example, code like this is
impossible in Python:

  float x = 2.5;
  printf("%d\n", *(int*)&x);

> 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++?

If I understand your question, I believe not; because Python doesn't
provide the low-level operators that would be necessary for it.



More information about the Python-list mailing list