Set type?

Klaas mike.klaas at gmail.com
Thu Jan 4 20:24:19 CET 2007


Fredrik Lundh wrote:

> > if type(var) is types.SetType:
> >    blah
> >
> > but that is not available in types module.  I am using 2.4
>
>      # set or subclass of set
>      if isinstance(var, set):
>          ...

or
if isinstance(var, (set, frozenset)):
   ...

-Mike




More information about the Python-list mailing list