We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7efba5a commit b9ba943Copy full SHA for b9ba943
pyenumerable/implementations/pure_python.py
@@ -1,8 +1,7 @@
1
from __future__ import annotations
2
3
from collections.abc import Callable, Iterable, Sequence
4
-from contextlib import suppress
5
-from itertools import chain
+from itertools import chain, islice
6
from typing import Any, Protocol
7
8
from pyenumerable.protocol import Associable, Enumerable
@@ -251,9 +250,9 @@ def take(
251
250
) -> Enumerable[TSource]:
252
return PurePythonEnumerable(
253
*(
254
- self.source[start_or_count:end]
+ islice(self.source, start_or_count, end)
255
if (end is not None)
256
- else self.source[:start_or_count]
+ else islice(self.source, start_or_count)
257
),
258
)
259
0 commit comments