Skip to content
Snippets Groups Projects
Commit a4476dae authored by Phil's avatar Phil
Browse files

Added working trans-type comparison for volatile values

parent ee7c4921
No related branches found
No related tags found
No related merge requests found
...@@ -66,6 +66,13 @@ class VolatileValue: ...@@ -66,6 +66,13 @@ class VolatileValue:
def __getattr__(self, attr): def __getattr__(self, attr):
if attr == "__setstate__": if attr == "__setstate__":
raise AttributeError(attr) raise AttributeError(attr)
elif attr == "__cmp__":
x = self._fix()
def cmp2(y,x=x):
if type(x) != type(y):
return -1
return x.__cmp__(y)
return cmp2
return getattr(self._fix(),attr) return getattr(self._fix(),attr)
def _fix(self): def _fix(self):
return None return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment