mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 10:34:19 +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
|
return False
|
||||||
|
|
||||||
def __getstate__(self):
|
def __getstate__(self):
|
||||||
return self.d.keys()
|
return (self.d.keys(),)
|
||||||
|
|
||||||
def __setstate__(self, t):
|
def __setstate__(self, (L,)):
|
||||||
for x in t:
|
self.d = {}
|
||||||
|
for x in L:
|
||||||
self.d[x] = None
|
self.d[x] = None
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
@ -140,6 +141,12 @@ class set(object):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
return self.d == other.d
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
return not self.d == other.d
|
||||||
|
|
||||||
## def __getstate__(self):
|
## def __getstate__(self):
|
||||||
## return self.d
|
## return self.d
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user