Added a few important helper methods.

This commit is contained in:
Jeremy Fincher 2003-04-29 07:36:18 +00:00
parent 45cdde675c
commit ce6b03d52f

View File

@ -119,10 +119,11 @@ class set(object):
return False
def __getstate__(self):
return self.d.keys()
return (self.d.keys(),)
def __setstate__(self, t):
for x in t:
def __setstate__(self, (L,)):
self.d = {}
for x in L:
self.d[x] = None
def __len__(self):
@ -140,6 +141,12 @@ class set(object):
except KeyError:
pass
def __eq__(self, other):
return self.d == other.d
def __ne__(self, other):
return not self.d == other.d
## def __getstate__(self):
## return self.d