Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
satella
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
satella
Commits
50e1fa10
Commit
50e1fa10
authored
2 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
v2.23.0 fix ListWrapperIterator
parent
7589134f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+2
-2
2 additions, 2 deletions
CHANGELOG.md
satella/__init__.py
+1
-1
1 addition, 1 deletion
satella/__init__.py
satella/coding/sequences/iterators.py
+8
-3
8 additions, 3 deletions
satella/coding/sequences/iterators.py
with
11 additions
and
6 deletions
CHANGELOG.md
+
2
−
2
View file @
50e1fa10
# 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
This diff is collapsed.
Click to expand it.
satella/__init__.py
+
1
−
1
View file @
50e1fa10
__version__
=
'
2.23
'
__version__
=
'
2.23
.0a1
'
This diff is collapsed.
Click to expand it.
satella/coding/sequences/iterators.py
+
8
−
3
View file @
50e1fa10
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment