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
24b5cc34
Commit
24b5cc34
authored
6 months ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
added `run_when_iterator_completes`
parent
9caec1e7
No related branches found
No related tags found
No related merge requests found
Pipeline
#64021
passed with stages
in 2 minutes and 42 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
satella/coding/generators.py
+1
-1
1 addition, 1 deletion
satella/coding/generators.py
satella/coding/iterators.py
+1
-1
1 addition, 1 deletion
satella/coding/iterators.py
with
2 additions
and
2 deletions
satella/coding/generators.py
+
1
−
1
View file @
24b5cc34
...
@@ -67,7 +67,7 @@ class RunActionAfterGeneratorCompletes(tp.Generator, metaclass=ABCMeta):
...
@@ -67,7 +67,7 @@ class RunActionAfterGeneratorCompletes(tp.Generator, metaclass=ABCMeta):
"""
This will run when this generator completes. Override it.
"""
"""
This will run when this generator completes. Override it.
"""
def
run_when_generator_completes
(
gen
:
tp
.
Generator
,
call_on_done
:
tp
.
Callable
[[...],
None
]
,
def
run_when_generator_completes
(
gen
:
tp
.
Generator
,
call_on_done
:
tp
.
Callable
,
*
args
,
**
kwargs
)
->
RunActionAfterGeneratorCompletes
:
*
args
,
**
kwargs
)
->
RunActionAfterGeneratorCompletes
:
"""
"""
Return the generator with call_on_done to be called on when it finishes
Return the generator with call_on_done to be called on when it finishes
...
...
This diff is collapsed.
Click to expand it.
satella/coding/iterators.py
+
1
−
1
View file @
24b5cc34
...
@@ -138,7 +138,7 @@ class hint_with_length:
...
@@ -138,7 +138,7 @@ class hint_with_length:
return
self
.
length
return
self
.
length
def
run_when_iterator_completes
(
iterator
,
func_to_run
,
*
args
,
**
kwargs
):
def
run_when_iterator_completes
(
iterator
:
tp
.
Iterator
,
func_to_run
:
tp
.
Callable
,
*
args
,
**
kwargs
):
"""
"""
Schedule a function to be called when an iterator completes.
Schedule a function to be called when an iterator completes.
...
...
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