Strong/weak typing
Maric Michaud
maric at aristote.info
Fri Aug 1 12:15:45 EDT 2008
Le Friday 01 August 2008 17:31:25 MartinRinehart at gmail.com, vous avez écrit :
> I'm writing Python as if it were strongly typed, never recycling a
> name to hold a type other than the original type.
>
> Is this good software engineering practice, or am I missing something
> Pythonic?
As already stated by others, Python is strongly typed, the fact is that the
type of an object is embeded with the object itself, not by the name you give
him at different place in a program.
But in fact you effectively re-use names in your programs, it's the basic of
the language.
Think of the following lines :
a, b = 0, 1
a += b
a, b = b, a
s = "foo"
s = s.upper()
--
_____________
Maric Michaud
More information about the Python-list
mailing list