Skip to content

Commit

Permalink
Use seq instead of tuple in Ring
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Matyasek committed Jan 25, 2020
1 parent 2df9164 commit c49d776
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ftoolz/adt/ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from cytoolz.functoolz import do

from ftoolz.typing import Seq
from ftoolz.typing import Seq, seq

_E = TypeVar('_E')

Expand All @@ -12,7 +12,7 @@ class Ring(Iterator[_E], Sized): # pylint: disable=E0239
"""Fixed-size in-memory rotating list of elements"""

# pylint: disable=W0231
def __init__(self, elements: Iterable[_E] = tuple()) -> None:
def __init__(self, elements: Iterable[_E] = seq()) -> None:
self._ring = deque(elements)

def __len__(self) -> int:
Expand All @@ -27,4 +27,4 @@ def __next__(self) -> _E:
return do(self._ring.append, self._ring.popleft())

def state(self) -> Seq[_E]:
return tuple(self._ring)
return seq(self._ring)

0 comments on commit c49d776

Please sign in to comment.