Skip to content

Commit

Permalink
improve docs of +
Browse files Browse the repository at this point in the history
  • Loading branch information
rudymatela committed Oct 4, 2024
1 parent 99f926e commit d65a20a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/leancheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ def lists(cls, enumerator):
return cls(lambda: _llist(enumerator.tiers))

def __add__(self, other):
"""
Use `+` to compute the sum of two enumerations:
>>> print(Enumerator[int] + Enumerator[bool])
[0, False, True, 1, 2, 3, ...]
"""
return Enumerator(lambda: _zippend(self.tiers(), other.tiers()))

def __mul__(self, other):
Expand Down

0 comments on commit d65a20a

Please sign in to comment.