Guido van Rossum wrote:

> But I'm not proposing to use hasattr(obj, '__call__'). I'm basically
> saying that the callable test has very little to do with whether the
> later call will succeed, because we have no way to test the signature.

I don't think that's needed for the sort of things people
want callable() for. I think they want it for the purpose
of implementing type-dependent APIs -- similar in spirit
to doing different things depending on whether you're
passed a sequence or not, etc.

For that purpose, hasattr(obj, '__call__') is sufficient,
I think. And if it's not, the API you're trying to
implement is ill-conceived in the first place, just like
testing for sequenceness is not a well-defined operation.

--
Greg
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to