Fixed take & skip
This commit is contained in:
@@ -15,7 +15,7 @@ __title__ = 'cpl_query.iterable'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2021 - 2022 sh-edraft.de'
|
||||
__version__ = '2022.10.0'
|
||||
__version__ = '2022.10.0.post2'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -27,4 +27,4 @@ from .ordered_iterable_abc import OrderedIterableABC
|
||||
from .ordered_iterable import OrderedIterable
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2022', minor='10', micro='0')
|
||||
version_info = VersionInfo(major='2022', minor='10', micro='0.post2')
|
||||
|
||||
@@ -262,9 +262,6 @@ class Iterable(IterableABC):
|
||||
if _index is None:
|
||||
raise ArgumentNoneException(ExceptionArgument.index)
|
||||
|
||||
if _index >= len(self):
|
||||
raise IndexOutOfRangeException()
|
||||
|
||||
return Iterable(self.type, values=self[_index:])
|
||||
|
||||
def skip_last(self, _index: int) -> IterableABC:
|
||||
@@ -276,9 +273,6 @@ class Iterable(IterableABC):
|
||||
|
||||
index = len(self) - _index
|
||||
|
||||
if index >= len(self) or index < 0:
|
||||
raise IndexOutOfRangeException()
|
||||
|
||||
result = Iterable()
|
||||
result.extend(self[:index])
|
||||
return result
|
||||
@@ -290,9 +284,6 @@ class Iterable(IterableABC):
|
||||
if _index is None:
|
||||
raise ArgumentNoneException(ExceptionArgument.index)
|
||||
|
||||
if _index >= len(self):
|
||||
raise IndexOutOfRangeException()
|
||||
|
||||
result = Iterable()
|
||||
result.extend(self[:_index])
|
||||
return result
|
||||
@@ -301,9 +292,6 @@ class Iterable(IterableABC):
|
||||
if self is None:
|
||||
raise ArgumentNoneException(ExceptionArgument.list)
|
||||
|
||||
if _index is None:
|
||||
raise ArgumentNoneException(ExceptionArgument.index)
|
||||
|
||||
index = len(self) - _index
|
||||
|
||||
if index >= len(self) or index < 0:
|
||||
|
||||
Reference in New Issue
Block a user