[Python-ideas] Bring back callable()

Antoine Pitrou solipsis at pitrou.net
Wed Nov 24 01:25:47 CET 2010


On Tue, 23 Nov 2010 18:50:13 -0500
Terry Reedy <tjreedy at udel.edu> wrote:
> On 11/23/2010 6:01 PM, Antoine Pitrou wrote:
> 
> > The substitute of writing `isinstance(x, collections.Callable)` is
> > not good, 1) because it's wordier 2) because collections is really not
> > an intuitive place where to look for a Callable ABC.
> 
> I thnk it should be in the abc module, along with WeakSet
> 
> The funny thing is that your rationale for not adding Picklable (just 
> try and catch exception) is essentially the rationale for removing 
> callable() ;-).

Well, I have never needed to know in advance whether an object was
picklable or not, while knowing whether it's callable has come often.

Regards

Antoine.





More information about the Python-ideas mailing list