strong/weak - dynamic/static [Was: Getting started]

Terry Reedy tjreedy at udel.edu
Thu Sep 19 14:52:13 EDT 2002


"Alex Martelli" <aleax at aleax.it> wrote in message
news:Ugmi9.114712$ub2.2441284 at news1.tin.it...
> Terry Reedy wrote:
...
> > Python objects are typed at creation.  Is that dynamic or static?

> Judge for yourself:
<snip>
> >>> x.__class__ = Y

I specifically *excluded* this type of assignment and the changed
behavior of new-style classes from my discussion when I wrote
"[Discussion of old and new classes and modification of
instance.__class__ omitted.]"  Classically, and in the C code, x has
type 'instance' (of a user-defined-class) both before and after the
class mod.  But this gets into the lengthy and most likely
inconclusive discussion that I intentionally avoided.

> If you find a way to name this behavior "static", you'll be well
> placed for the yearly Humpty Dumpty award.

This is pretty inane.  Again, I specifically excluded 'this behavior'
from my comments.  Anyway, my question *rhetorically* asked whether
creation-time typing (which is fixed except for the exception that I
excluded) is (to quote the OP) 'dynamic or static'.  I then suggested
that this dichotomy does not fit Python very well.

Terry J. Reedy





More information about the Python-list mailing list