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
e385603b
Commit
e385603b
authored
7 months ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
docs fixes
parent
36f8ccb6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#63324
failed with stages
Stage: test
Stage: build
in 37 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
docs/coding/sequences.rst
+10
-13
10 additions, 13 deletions
docs/coding/sequences.rst
with
11 additions
and
13 deletions
CHANGELOG.md
+
1
−
0
View file @
e385603b
# v2.25.8
*
fixed the modules page in documentation
*
added choose_with_index
# v2.25.7
...
...
This diff is collapsed.
Click to expand it.
docs/coding/sequences.rst
+
10
−
13
View file @
e385603b
=======================
Sequences and iterators
=======================
#######################
Rolling averages
================
...
...
@@ -42,22 +41,21 @@ iterate_callable
.. autofunction:: satella.coding.sequences.iterate_callable
c
hoos
e
------
C
hoos
ing stuff
------
--------
To return the first single element that returns true on given callable,
use the following function:
.. autofunction:: satella.coding.sequences.choose
choose_one
----------
Does the same thing as choose, but exhausts the generator and checks if there are no multiple
elements matching the callable. If there are, raises ValueError.
If you need to exhaust the generator, use the following:
.. autofunction:: satella.coding.sequences.choose_one
If you needn an index of the element found, use:
.. autofunction:: satella.coding.sequences.choose_with_index
AlreadySeen
-----------
...
...
@@ -115,7 +113,7 @@ take_n
For the rare moments, when you wish you could just do:
::
.. code-block:: python
iterator: tp.Iterator[T] = iterator
n_elements: tp.List[T] = iterator[:n]
...
...
@@ -125,7 +123,6 @@ However, this function comes to the rescue:
.. autofunction:: satella.coding.sequences.take_n
infinite_iterator
-----------------
...
...
@@ -139,7 +136,7 @@ A factory for filter functions that check if given object is
an instance of something (or multiple classes, if passed a tuple
of classes). Use like that
::
.. code-block:: python
orders: tp.List[BaseOrder] = ...
read_orders = filter(is_instance(ReadOrder), orders)
...
...
@@ -206,7 +203,7 @@ zip_shifted
.. autofunction:: satella.coding.sequences.zip_shifted
This is deprecated. Use
`
`zip(shift(...))`` instead.
This is deprecated. Use
:code:
`zip(shift(...))`` instead.
stop_after
...
...
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