[Python-3000] callable()

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Jul 23 03:30:55 CEST 2006


Andrew Koenig wrote:

> To my way of thinking, callable, iterable, and hashable are the same kind of
> concept,

But you've just pointed out that they're *not*
the same kind of concept, no matter how much
you might wish that there were.

The only way to make hashability testable at
less cost than attempting to do it would be
to have a separate __is_hashable__ method for
that purpose, which would recursively test
contents when necessary.

I'm far from convinced that testing for
hashability is necessary enough to be worth
going to that much bother. To my mind it's
another case where you shouldn't be
designing APIs based on that.

--
Greg


More information about the Python-3000 mailing list