diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a7572ac87a1b0b0ac83d3e6303a786911e3aedb..1bd2d03835bd12590bb6093360cefd009d909ddf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ -# v2.23 +# v2.23.0 * smart_zip to be deprecated in 2.23.0 * removed SIGINT from hang_unti_signal - +* updated ListWrapperIterator's signature \ No newline at end of file diff --git a/satella/__init__.py b/satella/__init__.py index 1d5a1bbab3cb2106c8dd41d2838837bfd51c7881..df43818420295410dade7384ce40de42666e0702 100644 --- a/satella/__init__.py +++ b/satella/__init__.py @@ -1 +1 @@ -__version__ = '2.23' +__version__ = '2.23.0a1' diff --git a/satella/coding/sequences/iterators.py b/satella/coding/sequences/iterators.py index e24c2c522bbf8352c1f06ad3f06df9c375f11ad1..944ab26a4bf01220252666fcddf9f5937625db91 100644 --- a/satella/coding/sequences/iterators.py +++ b/satella/coding/sequences/iterators.py @@ -2,6 +2,7 @@ import collections import itertools import typing as tp import warnings +from typing import _T_co from ..decorators import for_argument, wraps from ..recast_exceptions import rethrow_as, silence_excs @@ -478,7 +479,7 @@ def skip_first(iterator: Iteratable, n: int) -> tp.Iterator[T]: class _ListWrapperIteratorIterator(tp.Iterator[T]): - __slots__ = ('parent', 'pos') + __slots__ = 'parent', 'pos' def __init__(self, parent): self.parent = parent @@ -499,7 +500,7 @@ class _ListWrapperIteratorIterator(tp.Iterator[T]): return item -class ListWrapperIterator(tp.Generic[T]): +class ListWrapperIterator(tp.Iterator[T]): """ A wrapped for an iterator, enabling using it as a normal list. @@ -513,7 +514,11 @@ class ListWrapperIterator(tp.Generic[T]): This is additionally a generic class. """ - __slots__ = ('iterator', 'exhausted', 'list') + + def __next__(self) -> _T_co: + return self.next() + + __slots__ = 'iterator', 'exhausted', 'list' def __init__(self, iterator: Iteratable): self.iterator = iter(iterator)