-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
Why is sorted needed in 'freeze.py'?
Exception:
File ".../distalgo-master/da/freeze.py", line 88, in __hash__
h = self._cached_hash = hash(tuple(sorted(self)))
TypeError: '<' not supported between instances of 'SomeClass' and 'SomeClass'
class SomeClass:
def __init__(self, val):
self.val = val
class Primary(process):
def setup(nBackups: int):
pass
def run():
await(len(setof(p, received(("hello", _, _), from_= p))) >= nBackups)
values = setof(
v, received(("hello", v, _))
)
output(values)
class Backup(process):
def setup(primary):
pass
def run():
send(("hello", [SomeClass(1), SomeClass(2)], self), to = primary)
def main():
nbackups = 3
primary = new(Primary, (nbackups,), num= 1)
backups = new(Backup, (primary,), num= nbackups)
start(backups | primary)
Metadata
Metadata
Assignees
Labels
No labels