strong/weak - dynamic/static [Was: Getting started]
Alex Martelli
aleax at aleax.it
Thu Sep 19 11:43:48 EDT 2002
Terry Reedy wrote:
...
>>explaining or defining the concepts of ... dynamic and static typing.
>
> Python objects are typed at creation. Is that dynamic or static? I'm
Judge for yourself:
>>> class X(object): pass
...
>>> class Y(object): pass
...
>>> x = X()
>>> type(x)
<class '__main__.X'>
>>> x.__class__ = Y
>>> type(x)
<class '__main__.Y'>
>>>
If you find a way to name this behavior "static", you'll be well
placed for the yearly Humpty Dumpty award.
Alex
More information about the Python-list
mailing list