[Python-ideas] Allow isinstance second argument to be a set of types

Antoine Pitrou solipsis at pitrou.net
Mon Jul 4 17:28:43 CEST 2011


On Mon, 4 Jul 2011 15:35:55 +0100
Michael Foord <fuzzyman at gmail.com> wrote:
> On 4 July 2011 08:02, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> 
> > Michael Foord wrote:
> >
> >  It would feel cleaner to me if I could make FunctionTypes a set and use
> >> that as the second argument to isinstance. :-)
> >>
> >
> > Or more generally, any iterable object?
> 
> I don't care about any iterable. If a set would work then I'd be happy. :-)

Sure, but making it work for tuples and sets, but not other iterables,
would be a pretty lousy API.

Regards

Antoine.





More information about the Python-ideas mailing list