pythonic-fp.iterables 5.1.2__py3-none-any.whl → 5.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pythonic_fp/iterables/__init__.py +22 -19
- pythonic_fp/iterables/drop_take.py +8 -5
- pythonic_fp/iterables/folding.py +9 -1
- pythonic_fp/iterables/merging.py +10 -2
- {pythonic_fp_iterables-5.1.2.dist-info → pythonic_fp_iterables-5.1.3.dist-info}/METADATA +6 -6
- pythonic_fp_iterables-5.1.3.dist-info/RECORD +13 -0
- pythonic_fp_iterables-5.1.2.dist-info/RECORD +0 -13
- {pythonic_fp_iterables-5.1.2.dist-info → pythonic_fp_iterables-5.1.3.dist-info}/WHEEL +0 -0
- {pythonic_fp_iterables-5.1.2.dist-info → pythonic_fp_iterables-5.1.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2023-
|
|
1
|
+
# Copyright 2023-2026 Geoffrey R. Scheller
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
@@ -13,30 +13,33 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
"""
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
Tools for iterables
|
|
17
|
+
-------------------
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
| Module | Description |
|
|
21
|
-
+===========+===========================================+
|
|
22
|
-
| merging | Concatenating and merging iterables |
|
|
23
|
-
+-----------+-------------------------------------------+
|
|
24
|
-
| drop_take | Dropping and taking values from iterables |
|
|
25
|
-
+-----------+-------------------------------------------+
|
|
26
|
-
| folding | Reducing and accumulating iterables |
|
|
27
|
-
+-----------+-------------------------------------------+
|
|
19
|
+
.. admonition:: Library of functions for iterating iterables
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
+-----------+-------------------------------------------+
|
|
22
|
+
| Module | Description |
|
|
23
|
+
+===========+===========================================+
|
|
24
|
+
| merging | Concatenating and merging iterables |
|
|
25
|
+
+-----------+-------------------------------------------+
|
|
26
|
+
| drop_take | Dropping and taking values from iterables |
|
|
27
|
+
+-----------+-------------------------------------------+
|
|
28
|
+
| folding | Reducing and accumulating iterables |
|
|
29
|
+
+-----------+-------------------------------------------+
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
- at all times iterator protocol is assumed to be followed
|
|
31
|
+
.. important::
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
**Assumptions:**
|
|
34
|
+
|
|
35
|
+
- iterables are not necessarily iterators
|
|
36
|
+
- at all times iterator protocol is assumed to be followed
|
|
37
|
+
|
|
38
|
+
- all iterators are assumed to be iterable
|
|
39
|
+
- for all iterators ``foobar`` we assume ``iter(foobar) is foobar``
|
|
37
40
|
|
|
38
41
|
"""
|
|
39
42
|
|
|
40
43
|
__author__ = 'Geoffrey R. Scheller'
|
|
41
|
-
__copyright__ = 'Copyright (c) 2023-
|
|
44
|
+
__copyright__ = 'Copyright (c) 2023-2026 Geoffrey R. Scheller'
|
|
42
45
|
__license__ = 'Apache License 2.0'
|
|
@@ -13,7 +13,13 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
"""
|
|
16
|
-
|
|
16
|
+
Drop and Take
|
|
17
|
+
-------------
|
|
18
|
+
|
|
19
|
+
.. admonition:: module pythonic_fp.iterables.drop_take
|
|
20
|
+
|
|
21
|
+
Functions to drop or take values from an iterable.
|
|
22
|
+
|
|
17
23
|
"""
|
|
18
24
|
|
|
19
25
|
from collections.abc import Callable, Iterable, Iterator
|
|
@@ -30,9 +36,6 @@ __all__ = [
|
|
|
30
36
|
]
|
|
31
37
|
|
|
32
38
|
|
|
33
|
-
## dropping and taking
|
|
34
|
-
|
|
35
|
-
|
|
36
39
|
def drop[D](iterable: Iterable[D], n: int) -> Iterator[D]:
|
|
37
40
|
"""Drop the next n values from iterable.
|
|
38
41
|
|
|
@@ -163,4 +166,4 @@ def take_while_split[D](
|
|
|
163
166
|
value: Box[D] = Box()
|
|
164
167
|
it_pred = _take_while(iterator, pred, value)
|
|
165
168
|
|
|
166
|
-
return
|
|
169
|
+
return it_pred, concat(value, iterator)
|
pythonic_fp/iterables/folding.py
CHANGED
|
@@ -12,7 +12,15 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
"""
|
|
15
|
+
"""
|
|
16
|
+
Folding
|
|
17
|
+
-------
|
|
18
|
+
|
|
19
|
+
.. admonition:: module pythonic_fp.iterables.folding
|
|
20
|
+
|
|
21
|
+
Functions to reduce and accumulate values from iterables.
|
|
22
|
+
|
|
23
|
+
"""
|
|
16
24
|
|
|
17
25
|
from collections.abc import Callable, Iterable, Iterator
|
|
18
26
|
from typing import cast, Never
|
pythonic_fp/iterables/merging.py
CHANGED
|
@@ -12,7 +12,15 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
"""
|
|
15
|
+
"""
|
|
16
|
+
Merging Iterables
|
|
17
|
+
-----------------
|
|
18
|
+
|
|
19
|
+
.. admonition:: module pythonic_fp.iterables.merging
|
|
20
|
+
|
|
21
|
+
Functions to merge multiple iterables together into one.
|
|
22
|
+
|
|
23
|
+
"""
|
|
16
24
|
|
|
17
25
|
from collections.abc import Iterable, Iterator
|
|
18
26
|
from enum import auto, Enum
|
|
@@ -126,7 +134,7 @@ def blend[D](
|
|
|
126
134
|
merge_enum: MergeEnum = MergeEnum.Concat,
|
|
127
135
|
yield_partials: bool = False,
|
|
128
136
|
) -> Iterator[D]:
|
|
129
|
-
"""
|
|
137
|
+
"""Merge behavior based on value of merge_enum parameter.
|
|
130
138
|
|
|
131
139
|
:param iterables: Iterables to blend together.
|
|
132
140
|
:param merge_enum: ``MergeEnum`` to determine merging behavior.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythonic-fp-iterables
|
|
3
|
-
Version: 5.1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 5.1.3
|
|
4
|
+
Summary: Tools for iterables
|
|
5
5
|
Keywords: iterables,iterators
|
|
6
6
|
Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
|
|
7
7
|
Requires-Python: >=3.13
|
|
@@ -14,8 +14,8 @@ Classifier: Operating System :: OS Independent
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
15
|
Classifier: Typing :: Typed
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: pythonic-fp-fptools>=5.
|
|
18
|
-
Requires-Dist: pythonic-fp-gadgets>=
|
|
17
|
+
Requires-Dist: pythonic-fp-fptools>=5.2.0
|
|
18
|
+
Requires-Dist: pythonic-fp-gadgets>=4.0.2
|
|
19
19
|
Requires-Dist: pytest>=8.4.1 ; extra == "test"
|
|
20
20
|
Project-URL: Changelog, https://github.com/grscheller/pythonic-fp-iterables/blob/main/CHANGELOG.rst
|
|
21
21
|
Project-URL: Documentation, https://grscheller.github.io/pythonic-fp/iterables/development/build/html/
|
|
@@ -44,7 +44,7 @@ Library of functions for iterating iterables.
|
|
|
44
44
|
|
|
45
45
|
Part of the
|
|
46
46
|
`pythonic-fp
|
|
47
|
-
<https://grscheller.github.io/pythonic-fp
|
|
47
|
+
<https://grscheller.github.io/pythonic-fp>`_
|
|
48
48
|
PyPI projects.
|
|
49
49
|
|
|
50
50
|
Documentation
|
|
@@ -52,7 +52,7 @@ Documentation
|
|
|
52
52
|
|
|
53
53
|
Documentation for this project is hosted on
|
|
54
54
|
`GitHub Pages
|
|
55
|
-
<https://grscheller.github.io/pythonic-fp/iterables
|
|
55
|
+
<https://grscheller.github.io/pythonic-fp/iterables>`_.
|
|
56
56
|
|
|
57
57
|
Copyright and License
|
|
58
58
|
---------------------
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
pythonic_fp/iterables/__init__.py,sha256=oAoufgaFeHBH81d-ey738bBsVSximbrp0Rseb3EafnI,1663
|
|
2
|
+
pythonic_fp/iterables/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
pythonic_fp/iterables/drop_take.py,sha256=Kvj-B_xXD9t4tsIjMRdMXwSDKAeUsfbtLPs6X7wRapg,4847
|
|
4
|
+
pythonic_fp/iterables/drop_take.pyi,sha256=vPyByY4PxCGEuL6trI0aTK8fBr4xCuOgqhaKALwJ5Ys,653
|
|
5
|
+
pythonic_fp/iterables/folding.py,sha256=5-EJT-lp8EhAghMlNghla3rnVL0ywRS3-kGuO13oEVI,8711
|
|
6
|
+
pythonic_fp/iterables/folding.pyi,sha256=ZVrpB-D4kWoVwpCsQ2rc3GJ8iTzavAOQ5YK9LteAukU,1175
|
|
7
|
+
pythonic_fp/iterables/merging.py,sha256=mJ4nmIxSwuoi8LvYTHbU-JEUqkii1BdociRs59Dxq-A,4613
|
|
8
|
+
pythonic_fp/iterables/merging.pyi,sha256=KnuSFREXEpnbtTvMWsvn-KfeSjZ3ybP-6n9hCxjNKVs,533
|
|
9
|
+
pythonic_fp/iterables/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
pythonic_fp_iterables-5.1.3.dist-info/licenses/LICENSE,sha256=IJMkVWQUVy-SonK6SMaMotDQ6Zb-lVi2bUTiGp1GUO8,10774
|
|
11
|
+
pythonic_fp_iterables-5.1.3.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
12
|
+
pythonic_fp_iterables-5.1.3.dist-info/METADATA,sha256=Mi8wDsA-nnmMXWfrhS42W1CULGDYOcsSRqTk1nxNJNo,2064
|
|
13
|
+
pythonic_fp_iterables-5.1.3.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
pythonic_fp/iterables/__init__.py,sha256=UTde8stsDVG_5Z7fo37yiYeTu8fhkkv0QsQcQb_ixTU,1590
|
|
2
|
-
pythonic_fp/iterables/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
pythonic_fp/iterables/drop_take.py,sha256=VpcnQp0Nr4bUGXb-TD2UFl5kHo1fllAFoV_hlYHo8G0,4772
|
|
4
|
-
pythonic_fp/iterables/drop_take.pyi,sha256=vPyByY4PxCGEuL6trI0aTK8fBr4xCuOgqhaKALwJ5Ys,653
|
|
5
|
-
pythonic_fp/iterables/folding.py,sha256=lUvQzRU1wFbolw-b3bI1oU_xk7yIj2V5J8WA-qQxvUc,8612
|
|
6
|
-
pythonic_fp/iterables/folding.pyi,sha256=ZVrpB-D4kWoVwpCsQ2rc3GJ8iTzavAOQ5YK9LteAukU,1175
|
|
7
|
-
pythonic_fp/iterables/merging.py,sha256=CiBYp-iAr-iQrVTWK0wOkFDs9EJ9139p_MRiffIZJ2s,4485
|
|
8
|
-
pythonic_fp/iterables/merging.pyi,sha256=KnuSFREXEpnbtTvMWsvn-KfeSjZ3ybP-6n9hCxjNKVs,533
|
|
9
|
-
pythonic_fp/iterables/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
pythonic_fp_iterables-5.1.2.dist-info/licenses/LICENSE,sha256=IJMkVWQUVy-SonK6SMaMotDQ6Zb-lVi2bUTiGp1GUO8,10774
|
|
11
|
-
pythonic_fp_iterables-5.1.2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
12
|
-
pythonic_fp_iterables-5.1.2.dist-info/METADATA,sha256=G2d_xgzY-1WoYRBu-QoJbAO9PbV5O3uzcchy9fOO6ho,2143
|
|
13
|
-
pythonic_fp_iterables-5.1.2.dist-info/RECORD,,
|
|
File without changes
|
{pythonic_fp_iterables-5.1.2.dist-info → pythonic_fp_iterables-5.1.3.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|