mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 02:24:12 +01:00
Added a few important helper methods.
This commit is contained in:
parent
45cdde675c
commit
ce6b03d52f
13
src/fix.py
13
src/fix.py
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user