[Python-Dev] Re: Single- vs. Multi-pass iterability

David Abrahams David Abrahams" <david.abrahams@rcn.com
Fri, 19 Jul 2002 13:45:11 -0400


From: "Alex Martelli" <aleax@aleax.it>

> Introspection is good when you need to dispatch in a way that is
> not supported by the language you're using.  In Python (and most
> other languages), this mostly mean multiple dispatch -- you don't
> get it from the language, therefore, on the non-frequent occasions
> when you NEED it, you have to kludge it up.  Very similar to
> multiple inheritance in languages that don't support THAT, really.
>
> (Particularly in how people who've never used multiple X don't
> really understand that it buys you anything -- try interesting a
> dyed-in-the-wool Smalltalker in multiple inheritance, or anybody
> *but* a CLOS-head or Dylan-head in multiple dispatch...:-).

Ahem. *I'm* interested in multiple-dispatch (never used CLOS or Dylan). You
might not have noticed that I mentioned multimethods in my post about
supporting overloading in Boost.Python.

> Other aspects of introspection help you implement other primitives
> lacking in the language.  E.g. "make another like myself but not
> initialized" can be self.__class__.__new__(self.__class__) -- not
> the most elegant expression, but, hey, I've seen worse (such as
> NOT being able to express it at all, in languages lacking the
> needed ability to introspect:-).

Is that really introspection? It doesn't seem to ask a question.

> Looking at *ANOTHER* object this way isn't really INTROspection,
> btw -- it's EXTRAspection, by the Latin roots of these words:-).

Okay. I hope you won't be offended if I continue to use the wrong term so
that everyone else can understand me ;-)

-Dave