[Python-3000] callable()

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jul 18 09:04:29 CEST 2006


Andrew Koenig wrote:
> I note in PEP 3000 the proposal to remove callable(), with the comment "just
> call the object and catch the exception."

I think that should be amended to "just use hasattr(obj. '__call__')
instead". That's what callable() will become equivalent to once
old_style classes are gone.

Then it becomes a matter of whether it's worth having callable()
around as an alternative spelling. Those arguing in favour of
it would have to explain whether we should also have addable(),
subtractable(), mutiplyable(), indexable(), etc. etc. etc...

--
Greg


More information about the Python-3000 mailing list