Greg Ewing <greg.ewing <at> canterbury.ac.nz> writes:

> Talin wrote:
> 
> > 1) Getting rid of 'callable'.
> > 
> > The reccomended replacement is "just call the object and catch the resulting
> > exception",
> 
> No, the recommended replacement should be "redesign your API
> so that you don't need to test whether something is callable".

A common Python idiom is to take different actions based on the capabilities
of an object rather than its type. 'Duck Typing' is a special case of this, and
I think it's a fairly powerful technique (and deserving of more respect than
most language purists are willing to grant it.)

-- Talin

_______________________________________________
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