What is the class of myobj?

JXStern JXSternChangeX2R at gte.net
Wed Oct 16 18:06:41 EDT 2002


On Tue, 15 Oct 2002 22:06:01 -0700, Erik Max Francis <max at alcyone.com>
wrote:
>If you really do want to 
>"preflight" the object, perhaps asserting on some elementary
>functionality of a sequence object might be appropriate, such as:
>
>	assert a[0] # provided you know there's at least one element!

Well, this real polymorphism is interesting stuff.

Just because an object Y has an interface for tinkle with two
parameters, do we assume it's the same tinkle with two parameters that
object X has?

Is it really a bad thing to own a static analysis of the parameters
and semantics of your classes and objects?  I'm rather unpleased with
Python's lack of strong typing when you want it, and of the lack of
declarations to avoid accidental naming errors, especially when
case-sensitive.

Guess I'll just have to try it a few times every which way, until I
feel certain of my positions and preferences.

Joshua Stern




More information about the Python-list mailing list