Set type?

Robert Kern robert.kern at gmail.com
Thu Jan 4 13:54:10 EST 2007


_ wrote:
> How do you check to see if a variable is a set?  I would like to use
> 
> if type(var) is types.SetType:
>    blah
> 
> but that is not available in types module.  I am using 2.4

In [1627]: type(set()) is set
Out[1627]: True

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Python-list mailing list