[Python-3000] Iterators for dict keys, values, and items == annoying :)

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Mar 31 06:45:07 CEST 2006


Alex Martelli wrote:

> If the framework consuming X requested adaptation-to-X on all objects
 > it's passed,

This is the part that bothers me, I think. It
seems like all these adaptation requests would
be a huge burden on the framework developer.

In PyGUI, for example, I currently have about
2 or 3 dozen classes. Should I be defining and
registering a formal protocol for every one of
those? Should I be putting adaptation calls
in all of the few hundred places where an
object might come in from somewhere else and
I'm expecting it to be one of my classes?

Does it even stop there? Should I be doing
IInteger(x) on every x someone gives me that
I'm going to use as an integer?

What you're proposing seems to be tantamount
to a sort of dynamic version of static typing,
with much of its bookkeeping overhead. Python
tries to avoid this by not going in for that
sort of thing.

--
Greg


More information about the Python-3000 mailing list