Skip to content

Commit

Permalink
Utils: fix recursion error on pickling
Browse files Browse the repository at this point in the history
  • Loading branch information
leogama committed May 12, 2022
1 parent 298a099 commit 35621d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dill/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def discard(self, item):
except ValueError:
pass
def __reduce__(self):
return CheckerSet, (self.checker, iter(self))
return CheckerSet, (self.checker, tuple(self))

class TransSet(set):
"""transformer set that uses a constructor to modify added items"""
Expand All @@ -54,5 +54,5 @@ def discard(self, item):
def remove(self, item):
super().remove(self.constructor(item))
def __reduce__(self):
return TransSet, (self.constructor, iter(self))
return TransSet, (self.constructor, tuple(self))

0 comments on commit 35621d3

Please sign in to comment.