pythonic-fp.containers 4.0.1__py3-none-any.whl → 4.1.0__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/containers/__init__.py +8 -9
- pythonic_fp/containers/functional_tuple.py +77 -36
- pythonic_fp/containers/immutable_list.py +146 -38
- pythonic_fp/containers/immutable_list.pyi +1 -1
- {pythonic_fp_containers-4.0.1.dist-info → pythonic_fp_containers-4.1.0.dist-info}/METADATA +13 -13
- pythonic_fp_containers-4.1.0.dist-info/RECORD +11 -0
- pythonic_fp_containers-4.0.1.dist-info/RECORD +0 -11
- {pythonic_fp_containers-4.0.1.dist-info → pythonic_fp_containers-4.1.0.dist-info}/WHEEL +0 -0
- {pythonic_fp_containers-4.0.1.dist-info → pythonic_fp_containers-4.1.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -13,16 +13,15 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
"""
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
Containers with FP interfaces
|
|
17
|
+
-----------------------------
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
+---------------------------------------------+-----------+------------------+
|
|
19
|
+
.. admonition:: Functional variants of Python builtins
|
|
20
|
+
|
|
21
|
+
Not sure the direction this should take.
|
|
22
|
+
|
|
23
|
+
- class **FTuple:** A tuple-like object with a functional interface.
|
|
24
|
+
- class **IList:** An immutable, hashable list-like object.
|
|
26
25
|
|
|
27
26
|
"""
|
|
28
27
|
|
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
|
|
16
|
-
"""Pythonic FP - Functional Tuple"""
|
|
17
|
-
|
|
18
16
|
from collections.abc import Callable, Iterator
|
|
19
17
|
from typing import cast, Never, overload, SupportsIndex
|
|
20
18
|
from pythonic_fp.iterables.folding import accumulate
|
|
@@ -25,26 +23,42 @@ __all__ = ['FTuple']
|
|
|
25
23
|
|
|
26
24
|
class FTuple[D](tuple[D, ...]):
|
|
27
25
|
"""
|
|
28
|
-
.. admonition:: Functional Tuple
|
|
26
|
+
.. admonition:: Functional Tuple
|
|
29
27
|
|
|
28
|
+
- intended for further inheritance
|
|
30
29
|
- supports both indexing and slicing
|
|
31
30
|
- int multiplication and FTuple addition supported
|
|
32
31
|
- addition concatenates results, resulting in a Union type
|
|
33
32
|
- both left and right int multiplication supported
|
|
34
33
|
- homogeneous in its data type
|
|
35
|
-
- supports being further inherited from
|
|
36
34
|
- unslotted
|
|
37
35
|
|
|
36
|
+
.. note::
|
|
37
|
+
|
|
38
|
+
Example of code very early in project. Different ways
|
|
39
|
+
to use __dunders__ than what I do lately.
|
|
40
|
+
|
|
38
41
|
"""
|
|
39
42
|
|
|
40
43
|
def __reversed__(self) -> Iterator[D]:
|
|
44
|
+
"""
|
|
45
|
+
.. admonition:: reverse iter
|
|
46
|
+
|
|
47
|
+
:yields: the tuples elements in reverse order
|
|
48
|
+
|
|
49
|
+
"""
|
|
41
50
|
for ii in range(len(self) - 1, -1, -1):
|
|
42
51
|
yield (self[ii])
|
|
43
52
|
|
|
44
|
-
def __repr__(self) -> str:
|
|
45
|
-
return f'{self.__class__.__name__}(' + ', '.join(map(repr, self)) + ')'
|
|
46
|
-
|
|
47
53
|
def __eq__(self, other: object, /) -> bool:
|
|
54
|
+
"""
|
|
55
|
+
.. admonition:: equality comparison
|
|
56
|
+
|
|
57
|
+
:param other: The ``object`` to which to be compared.
|
|
58
|
+
:returns: ``True`` if ``other`` is the same type and
|
|
59
|
+
corresponding elements compare as equal.
|
|
60
|
+
|
|
61
|
+
"""
|
|
48
62
|
if not isinstance(other, self.__class__):
|
|
49
63
|
return False
|
|
50
64
|
if (length := len(self)) != len(other):
|
|
@@ -67,6 +81,9 @@ class FTuple[D](tuple[D, ...]):
|
|
|
67
81
|
else:
|
|
68
82
|
return super().__getitem__(idx)
|
|
69
83
|
|
|
84
|
+
def __repr__(self) -> str:
|
|
85
|
+
return f'{self.__class__.__name__}(' + ', '.join(map(repr, self)) + ')'
|
|
86
|
+
|
|
70
87
|
def foldl[L](
|
|
71
88
|
self,
|
|
72
89
|
f: Callable[[L, D], L],
|
|
@@ -74,16 +91,20 @@ class FTuple[D](tuple[D, ...]):
|
|
|
74
91
|
start: L | None = None,
|
|
75
92
|
default: L | None = None,
|
|
76
93
|
) -> L:
|
|
77
|
-
"""
|
|
94
|
+
"""
|
|
95
|
+
.. admonition:: fold left
|
|
78
96
|
|
|
79
|
-
|
|
80
|
-
- first argument of function ``f`` is for the accumulated value
|
|
97
|
+
Reduce left with optional starting and default values.
|
|
81
98
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
99
|
+
:param f: The folding function, first argument is for
|
|
100
|
+
the accumulated value.
|
|
101
|
+
:param start: An optional starting value.
|
|
102
|
+
:param default: An optional default value
|
|
103
|
+
if fold does not exist.
|
|
104
|
+
:raises ValueError: When ``FTuple`` empty and a start value
|
|
105
|
+
was not not given.
|
|
106
|
+
:returns: Folded value if it exists, otherwise
|
|
107
|
+
the default value if given.
|
|
87
108
|
|
|
88
109
|
"""
|
|
89
110
|
it_self = iter(self)
|
|
@@ -107,13 +128,20 @@ class FTuple[D](tuple[D, ...]):
|
|
|
107
128
|
start: R | None = None,
|
|
108
129
|
default: R | None = None,
|
|
109
130
|
) -> R:
|
|
110
|
-
"""
|
|
131
|
+
"""
|
|
132
|
+
.. admonition:: fold right
|
|
111
133
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
134
|
+
Reduce right with optional starting and default values.
|
|
135
|
+
|
|
136
|
+
:param f: The folding function, second argument is for
|
|
137
|
+
the accumulated value.
|
|
138
|
+
:param start: An optional starting value.
|
|
139
|
+
:param default: An optional default value
|
|
140
|
+
if fold does not exist.
|
|
141
|
+
:raises ValueError: when ``FTuple`` empty and a start value
|
|
142
|
+
was not given
|
|
143
|
+
:returns: The folded value if it exists, otherwise
|
|
144
|
+
the default value if given.
|
|
117
145
|
|
|
118
146
|
"""
|
|
119
147
|
it_self = reversed(self)
|
|
@@ -131,9 +159,13 @@ class FTuple[D](tuple[D, ...]):
|
|
|
131
159
|
return acc
|
|
132
160
|
|
|
133
161
|
def copy(self) -> 'FTuple[D]':
|
|
134
|
-
"""
|
|
162
|
+
"""
|
|
163
|
+
.. admonition:: copy
|
|
135
164
|
|
|
136
|
-
|
|
165
|
+
Return a shallow copy of ``FTuple`` in O(1)
|
|
166
|
+
time & space complexity.
|
|
167
|
+
|
|
168
|
+
:returns: A new ``FTuple`` instance.
|
|
137
169
|
|
|
138
170
|
"""
|
|
139
171
|
return self.__class__(self)
|
|
@@ -153,14 +185,12 @@ class FTuple[D](tuple[D, ...]):
|
|
|
153
185
|
def accummulate[L](
|
|
154
186
|
self, f: Callable[[L, D], L], s: L | None = None, /
|
|
155
187
|
) -> 'FTuple[L]':
|
|
156
|
-
"""
|
|
157
|
-
|
|
158
|
-
Accumulate partial fold with an optional starting value,
|
|
159
|
-
results in an ``FTuple``.
|
|
188
|
+
"""
|
|
189
|
+
.. admonition:: accumulate partial folds
|
|
160
190
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
191
|
+
:param f: Folding function used to produce partial folds.
|
|
192
|
+
:param s: Optional starting value.
|
|
193
|
+
:returns: New ``FTuple`` of the partial folds.
|
|
164
194
|
|
|
165
195
|
"""
|
|
166
196
|
if s is None:
|
|
@@ -168,6 +198,13 @@ class FTuple[D](tuple[D, ...]):
|
|
|
168
198
|
return FTuple(accumulate(self, f, s))
|
|
169
199
|
|
|
170
200
|
def map[U](self, f: Callable[[D], U], /) -> 'FTuple[U]':
|
|
201
|
+
"""
|
|
202
|
+
.. admonition:: map
|
|
203
|
+
|
|
204
|
+
:param f: Folding function used to produce partial folds.
|
|
205
|
+
:returns: A new ``FTuple`` instance.
|
|
206
|
+
|
|
207
|
+
"""
|
|
171
208
|
return FTuple(map(f, self))
|
|
172
209
|
|
|
173
210
|
def bind[U](
|
|
@@ -176,13 +213,17 @@ class FTuple[D](tuple[D, ...]):
|
|
|
176
213
|
merge_type: MergeEnum = MergeEnum.Concat,
|
|
177
214
|
yield_partials: bool = False,
|
|
178
215
|
) -> 'FTuple[U] | Never':
|
|
179
|
-
"""
|
|
216
|
+
"""
|
|
217
|
+
.. admonition:: bind
|
|
218
|
+
|
|
219
|
+
Flat map function ``f`` with the ``FTuple`` with different
|
|
220
|
+
merging strategies.
|
|
180
221
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
222
|
+
:param f: Function ``D -> FTuple[U]``
|
|
223
|
+
:param merge_type: ``MergeEnum`` to determine how to merge the result.
|
|
224
|
+
:param yield_partials: Yield unmatched values if ``MergeEnum`` given as merge type.
|
|
225
|
+
:returns: A new ``FTuple`` instance.
|
|
226
|
+
:raises ValueError: If given an unknown merge enumeration.
|
|
186
227
|
|
|
187
228
|
"""
|
|
188
229
|
return FTuple(
|
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
"""Pythonic FP - Immutable guaranteed hashable lists."""
|
|
16
|
-
|
|
17
15
|
from collections.abc import Callable, Iterable, Iterator, Hashable
|
|
18
16
|
from typing import cast, Never, overload
|
|
19
17
|
from pythonic_fp.iterables.folding import accumulate
|
|
@@ -24,7 +22,7 @@ __all__ = ['IList']
|
|
|
24
22
|
|
|
25
23
|
class IList[D](Hashable):
|
|
26
24
|
"""
|
|
27
|
-
.. admonition::
|
|
25
|
+
.. admonition:: immutable list like data structure
|
|
28
26
|
|
|
29
27
|
- hashability should be enforced by LSP tooling
|
|
30
28
|
- hashability will be enforced at runtime
|
|
@@ -39,16 +37,18 @@ class IList[D](Hashable):
|
|
|
39
37
|
__slots__ = ('_ds', '_len', '_hash')
|
|
40
38
|
__match_args__ = ('_ds', '_len')
|
|
41
39
|
|
|
42
|
-
def __init__(self, *
|
|
40
|
+
def __init__(self, *ds: Iterable[D]) -> None:
|
|
43
41
|
"""
|
|
44
|
-
|
|
42
|
+
.. admonition:: init
|
|
43
|
+
|
|
44
|
+
:param ds: One optional iterable.
|
|
45
45
|
|
|
46
46
|
"""
|
|
47
|
-
if (size := len(
|
|
47
|
+
if (size := len(ds)) > 1:
|
|
48
48
|
msg = f'IList expects at most 1 iterable argument, got {size}'
|
|
49
49
|
raise ValueError(msg)
|
|
50
50
|
else:
|
|
51
|
-
self._ds: tuple[D, ...] = tuple(
|
|
51
|
+
self._ds: tuple[D, ...] = tuple(ds[0]) if size == 1 else tuple()
|
|
52
52
|
self._len = len(self._ds)
|
|
53
53
|
try:
|
|
54
54
|
self._hash = hash((self._len, 42) + self._ds)
|
|
@@ -57,26 +57,55 @@ class IList[D](Hashable):
|
|
|
57
57
|
raise TypeError(msg)
|
|
58
58
|
|
|
59
59
|
def __hash__(self) -> int:
|
|
60
|
+
"""
|
|
61
|
+
.. admonition:: hash
|
|
62
|
+
|
|
63
|
+
Hashability enforced at runtime by initializer.
|
|
64
|
+
|
|
65
|
+
:returns: Hash value.
|
|
66
|
+
|
|
67
|
+
"""
|
|
60
68
|
return self._hash
|
|
61
69
|
|
|
62
70
|
def __iter__(self) -> Iterator[D]:
|
|
71
|
+
"""
|
|
72
|
+
.. admonition:: iterate
|
|
73
|
+
|
|
74
|
+
Forward iterate, left to right.
|
|
75
|
+
|
|
76
|
+
:yields: The contained values.
|
|
77
|
+
|
|
78
|
+
"""
|
|
63
79
|
return iter(self._ds)
|
|
64
80
|
|
|
65
81
|
def __reversed__(self) -> Iterator[D]:
|
|
82
|
+
"""
|
|
83
|
+
.. admonition:: iterate
|
|
84
|
+
|
|
85
|
+
Reverse iterate, left to right.
|
|
86
|
+
|
|
87
|
+
:yields: The contained values in reverse order.
|
|
88
|
+
|
|
89
|
+
"""
|
|
66
90
|
return reversed(self._ds)
|
|
67
91
|
|
|
68
92
|
def __bool__(self) -> bool:
|
|
93
|
+
"""
|
|
94
|
+
.. admonition:: bool
|
|
95
|
+
|
|
96
|
+
:returns: ``True`` if not empty, ``False`` if empty.
|
|
97
|
+
|
|
98
|
+
"""
|
|
69
99
|
return bool(self._ds)
|
|
70
100
|
|
|
71
101
|
def __len__(self) -> int:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
def __repr__(self) -> str:
|
|
75
|
-
return 'immutable_list(' + ', '.join(map(repr, self)) + ')'
|
|
102
|
+
"""
|
|
103
|
+
.. admonition:: len
|
|
76
104
|
|
|
77
|
-
|
|
78
|
-
return '((' + ', '.join(map(repr, self)) + '))'
|
|
105
|
+
:returns: The number of items in the ``Ilist``.
|
|
79
106
|
|
|
107
|
+
"""
|
|
108
|
+
return len(self._ds)
|
|
80
109
|
def __eq__(self, other: object, /) -> bool:
|
|
81
110
|
if not isinstance(other, IList):
|
|
82
111
|
return NotImplemented # magic object
|
|
@@ -92,10 +121,37 @@ class IList[D](Hashable):
|
|
|
92
121
|
def __getitem__(self, idx: slice, /) -> 'IList[D]': ...
|
|
93
122
|
|
|
94
123
|
def __getitem__(self, idx: slice | int, /) -> 'IList[D] | D':
|
|
124
|
+
"""
|
|
125
|
+
.. admonition:: getitem
|
|
126
|
+
|
|
127
|
+
Indexable and sliceable but otherwise immutable.
|
|
128
|
+
|
|
129
|
+
:param idx: Either a ``slice`` or and ``index``.
|
|
130
|
+
:returns: A slice or the value.
|
|
131
|
+
|
|
132
|
+
"""
|
|
95
133
|
if isinstance(idx, slice):
|
|
96
134
|
return IList(self._ds[idx])
|
|
97
135
|
return self._ds[idx]
|
|
98
136
|
|
|
137
|
+
def __repr__(self) -> str:
|
|
138
|
+
"""
|
|
139
|
+
.. admonition:: repr string
|
|
140
|
+
|
|
141
|
+
:returns: A string to reproduce the value.
|
|
142
|
+
|
|
143
|
+
"""
|
|
144
|
+
return 'immutable_list(' + ', '.join(map(repr, self)) + ')'
|
|
145
|
+
|
|
146
|
+
def __str__(self) -> str:
|
|
147
|
+
"""
|
|
148
|
+
.. admonition:: user string
|
|
149
|
+
|
|
150
|
+
:returns: A string meaningful to an end user.
|
|
151
|
+
|
|
152
|
+
"""
|
|
153
|
+
return '((' + ', '.join(map(repr, self)) + '))'
|
|
154
|
+
|
|
99
155
|
def foldl[L](
|
|
100
156
|
self,
|
|
101
157
|
f: Callable[[L, D], L],
|
|
@@ -103,13 +159,16 @@ class IList[D](Hashable):
|
|
|
103
159
|
start: L | None = None,
|
|
104
160
|
default: L | None = None,
|
|
105
161
|
) -> L | None:
|
|
106
|
-
"""
|
|
162
|
+
"""
|
|
163
|
+
.. admonition:: fold left
|
|
107
164
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
165
|
+
:param f: Folding function, first argument is for
|
|
166
|
+
the accumulated value.
|
|
167
|
+
:param start: Optional starting value.
|
|
168
|
+
:param default: Optional default value if fold does not exist.
|
|
169
|
+
:returns: Left folded value.
|
|
170
|
+
:raises ValueError: When empty and neither a start value or
|
|
171
|
+
default value not given.
|
|
113
172
|
|
|
114
173
|
"""
|
|
115
174
|
it = iter(self._ds)
|
|
@@ -135,13 +194,16 @@ class IList[D](Hashable):
|
|
|
135
194
|
start: R | None = None,
|
|
136
195
|
default: R | None = None,
|
|
137
196
|
) -> R | None:
|
|
138
|
-
"""
|
|
197
|
+
"""
|
|
198
|
+
.. admonition:: fold right
|
|
139
199
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
200
|
+
:param f: Folding function, second argument is for
|
|
201
|
+
the accumulated value.
|
|
202
|
+
:param start: Optional starting value.
|
|
203
|
+
:param default: Optional default value if fold does not exist.
|
|
204
|
+
:returns: Right folded value.
|
|
205
|
+
:raises ValueError: When empty and neither a start value or
|
|
206
|
+
default value not given.
|
|
145
207
|
|
|
146
208
|
"""
|
|
147
209
|
it = reversed(self._ds)
|
|
@@ -161,6 +223,18 @@ class IList[D](Hashable):
|
|
|
161
223
|
return acc
|
|
162
224
|
|
|
163
225
|
def __add__(self, other: 'IList[D]', /) -> 'IList[D]':
|
|
226
|
+
"""
|
|
227
|
+
.. admonition:: add by concatenation
|
|
228
|
+
|
|
229
|
+
:param other: The ``other`` same typed ``IList``.
|
|
230
|
+
:returns: New ``IList`` instance with concatenated values.
|
|
231
|
+
:raises ValueError: When ``other`` is not an ``IList``.
|
|
232
|
+
|
|
233
|
+
.. admonition:: TODO
|
|
234
|
+
|
|
235
|
+
Return ``NotImplemented`` if appropriate?
|
|
236
|
+
|
|
237
|
+
"""
|
|
164
238
|
if not isinstance(other, IList):
|
|
165
239
|
msg = 'IList being added to something not an IList'
|
|
166
240
|
raise ValueError(msg)
|
|
@@ -168,22 +242,45 @@ class IList[D](Hashable):
|
|
|
168
242
|
return IList(concat(self, other))
|
|
169
243
|
|
|
170
244
|
def __mul__(self, num: int, /) -> 'IList[D]':
|
|
245
|
+
"""
|
|
246
|
+
.. admonition:: add by concatenation
|
|
247
|
+
|
|
248
|
+
:param other: The ``other`` same typed ``IList``.
|
|
249
|
+
:returns: New ``IList`` instance with concatenated values.
|
|
250
|
+
:raises ValueError: When ``other`` is not an ``IList``.
|
|
251
|
+
|
|
252
|
+
.. admonition:: TODO
|
|
253
|
+
|
|
254
|
+
Consider returning ``NotImplemented`` if appropriate?
|
|
255
|
+
Maybe define a "column vector" version?
|
|
256
|
+
|
|
257
|
+
"""
|
|
171
258
|
return IList(self._ds.__mul__(num if num > 0 else 0))
|
|
172
259
|
|
|
173
260
|
def __rmul__(self, num: int, /) -> 'IList[D]':
|
|
261
|
+
"""
|
|
262
|
+
.. admonition:: concatenation with itself
|
|
263
|
+
|
|
264
|
+
:param num: Number of times to concatenate ``IList``
|
|
265
|
+
with itself.
|
|
266
|
+
:returns: A new ``IList`` instance with concatenated values.
|
|
267
|
+
:raises ValueError: When ``other`` is not an ``IList``.
|
|
268
|
+
|
|
269
|
+
"""
|
|
174
270
|
return IList(self._ds.__mul__(num if num > 0 else 0))
|
|
175
271
|
|
|
176
272
|
def accummulate[L](
|
|
177
273
|
self, f: Callable[[L, D], L], s: L | None = None, /
|
|
178
274
|
) -> 'IList[L]':
|
|
179
|
-
"""
|
|
275
|
+
"""
|
|
276
|
+
.. admonition:: accumulate partial folds
|
|
180
277
|
|
|
181
|
-
|
|
182
|
-
|
|
278
|
+
Accumulate partial fold with an optional starting value,
|
|
279
|
+
results in an ``IList``.
|
|
183
280
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
281
|
+
:param f: Folding function used to produce partial folds.
|
|
282
|
+
:param s: Optional starting value.
|
|
283
|
+
:returns: New ``IList`` of the partial folds.
|
|
187
284
|
|
|
188
285
|
"""
|
|
189
286
|
if s is None:
|
|
@@ -191,6 +288,13 @@ class IList[D](Hashable):
|
|
|
191
288
|
return IList(accumulate(self, f, s))
|
|
192
289
|
|
|
193
290
|
def map[U](self, f: Callable[[D], U], /) -> 'IList[U]':
|
|
291
|
+
"""
|
|
292
|
+
.. admonition:: map
|
|
293
|
+
|
|
294
|
+
:parameter f: Function to map over the ``IList``.
|
|
295
|
+
:returns: A new ``IList`` instance with the mapped values.
|
|
296
|
+
|
|
297
|
+
"""
|
|
194
298
|
return IList(map(f, self))
|
|
195
299
|
|
|
196
300
|
def bind[U](
|
|
@@ -199,13 +303,17 @@ class IList[D](Hashable):
|
|
|
199
303
|
merge_enum: MergeEnum = MergeEnum.Concat,
|
|
200
304
|
yield_partials: bool = False,
|
|
201
305
|
) -> 'IList[U] | Never':
|
|
202
|
-
"""
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
306
|
+
"""
|
|
307
|
+
.. admonition:: bind
|
|
308
|
+
|
|
309
|
+
:param f: Function ``D -> IList[U]`` to bind with different
|
|
310
|
+
merge strategies.
|
|
311
|
+
:param merge_type: ``MergeEnum`` to determine how to merge
|
|
312
|
+
the result.
|
|
313
|
+
:param yield_partials: Yield unmatched values if ``MergeEnum``
|
|
314
|
+
given as merge type.
|
|
315
|
+
:return: New ``IList`` instance.
|
|
316
|
+
:raises ValueError: If given an unknown merge enumeration.
|
|
209
317
|
|
|
210
318
|
"""
|
|
211
319
|
return IList(
|
|
@@ -7,7 +7,7 @@ __all__ = ['IList']
|
|
|
7
7
|
|
|
8
8
|
class IList[D](Hashable):
|
|
9
9
|
__match_args__: Incomplete
|
|
10
|
-
def __init__(self, *
|
|
10
|
+
def __init__(self, *ds: Iterable[D]) -> None: ...
|
|
11
11
|
def __hash__(self) -> int: ...
|
|
12
12
|
def __iter__(self) -> Iterator[D]: ...
|
|
13
13
|
def __reversed__(self) -> Iterator[D]: ...
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythonic-fp-containers
|
|
3
|
-
Version: 4.0
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 4.1.0
|
|
4
|
+
Summary: Containers with FP interfaces
|
|
5
5
|
Keywords: functional_containers,functional_tuple,immutable_list
|
|
6
6
|
Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
|
|
7
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Python: >=3.13
|
|
8
8
|
Description-Content-Type: text/x-rst
|
|
9
9
|
Classifier: Development Status :: 3 - Alpha
|
|
10
10
|
Classifier: Framework :: Pytest
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
15
|
Classifier: Typing :: Typed
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: pythonic-fp-circulararray>=6.0.
|
|
17
|
+
Requires-Dist: pythonic-fp-circulararray>=6.0.4
|
|
18
18
|
Requires-Dist: pythonic-fp-fptools>=5.2.0
|
|
19
19
|
Requires-Dist: pythonic-fp-iterables>=5.1.3
|
|
20
20
|
Requires-Dist: pytest>=8.4.1 ; extra == "test"
|
|
21
21
|
Project-URL: Changelog, https://github.com/grscheller/pythonic-fp-containers/blob/main/CHANGELOG.rst
|
|
22
|
-
Project-URL: Documentation, https://grscheller.github.io/pythonic-fp/containers
|
|
23
|
-
Project-URL: Homepage, https://grscheller.github.io/pythonic-fp/
|
|
22
|
+
Project-URL: Documentation, https://grscheller.github.io/pythonic-fp/projects/containers.html
|
|
23
|
+
Project-URL: Homepage, https://grscheller.github.io/pythonic-fp/
|
|
24
24
|
Project-URL: Source, https://github.com/grscheller/pythonic-fp-containers
|
|
25
25
|
Provides-Extra: test
|
|
26
26
|
|
|
@@ -28,8 +28,8 @@ Pythonic FP - Containers
|
|
|
28
28
|
========================
|
|
29
29
|
|
|
30
30
|
PyPI project
|
|
31
|
-
`pythonic-fp
|
|
32
|
-
<https://pypi.org/project/pythonic-fp
|
|
31
|
+
`pythonic-fp-containers
|
|
32
|
+
<https://pypi.org/project/pythonic-fp-containers>`_.
|
|
33
33
|
|
|
34
34
|
Python package of container like data structures with functional
|
|
35
35
|
programming inspired tweaks.
|
|
@@ -44,19 +44,19 @@ programming inspired tweaks.
|
|
|
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
|
|
51
51
|
-------------
|
|
52
52
|
|
|
53
|
-
Documentation for this project
|
|
53
|
+
Documentation and other links for this project are hosted on
|
|
54
54
|
`GitHub Pages
|
|
55
|
-
<https://grscheller.github.io/pythonic-fp/containers>`_.
|
|
55
|
+
<https://grscheller.github.io/pythonic-fp/projects/containers.html>`_.
|
|
56
56
|
|
|
57
57
|
Copyright and License
|
|
58
58
|
---------------------
|
|
59
59
|
|
|
60
|
-
Copyright (c) 2023-
|
|
60
|
+
Copyright (c) 2023-2026 Geoffrey R. Scheller. Licensed under the Apache
|
|
61
61
|
License, Version 2.0. See the LICENSE file for details.
|
|
62
62
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
pythonic_fp/containers/__init__.py,sha256=J1UvKHza0iDCR1GrVSUeps5LHsPc56xISvkbnGXOJtA,1034
|
|
2
|
+
pythonic_fp/containers/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
pythonic_fp/containers/functional_tuple.py,sha256=3Vdg3Fri5wGDdWv4bomS7xqWLy0B_eMQuXojZhgvKYM,7498
|
|
4
|
+
pythonic_fp/containers/functional_tuple.pyi,sha256=g8IvlIhPxecEsetEexZ7WmN9Ifdh-vAeK0z9SwLiCGE,1182
|
|
5
|
+
pythonic_fp/containers/immutable_list.py,sha256=9qtSF5R7O2f-Dzji2G11CneC0BTrk3WA5EV3z2sdnms,9796
|
|
6
|
+
pythonic_fp/containers/immutable_list.pyi,sha256=1p7w7FP-OpCHvCBJIlztoP_uUoZIoj9uI_XGKEib-kU,1371
|
|
7
|
+
pythonic_fp/containers/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
pythonic_fp_containers-4.1.0.dist-info/licenses/LICENSE,sha256=IJMkVWQUVy-SonK6SMaMotDQ6Zb-lVi2bUTiGp1GUO8,10774
|
|
9
|
+
pythonic_fp_containers-4.1.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
10
|
+
pythonic_fp_containers-4.1.0.dist-info/METADATA,sha256=I5j_6Nc6ykHEfx6ThA1S9x3ifqyHyYxdktbMw5wNr_w,2387
|
|
11
|
+
pythonic_fp_containers-4.1.0.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
pythonic_fp/containers/__init__.py,sha256=NVk-lAQNKGHTS0I_jEYrKTzfekisfgAoEOtwchgjemw,1346
|
|
2
|
-
pythonic_fp/containers/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
pythonic_fp/containers/functional_tuple.py,sha256=re4ICQo-ZOyvlgUsC37_4eIk02l3dWRcX-Emfh9Us8A,6490
|
|
4
|
-
pythonic_fp/containers/functional_tuple.pyi,sha256=g8IvlIhPxecEsetEexZ7WmN9Ifdh-vAeK0z9SwLiCGE,1182
|
|
5
|
-
pythonic_fp/containers/immutable_list.py,sha256=iBFCUdIbROg4Ch2PoL8VZQl7gkZLwTGj54_cOQkhf4w,6920
|
|
6
|
-
pythonic_fp/containers/immutable_list.pyi,sha256=HRm0Updbx9UJpl5RI0prOwimSHDUJtM-3t2hEmYz6kw,1372
|
|
7
|
-
pythonic_fp/containers/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
pythonic_fp_containers-4.0.1.dist-info/licenses/LICENSE,sha256=IJMkVWQUVy-SonK6SMaMotDQ6Zb-lVi2bUTiGp1GUO8,10774
|
|
9
|
-
pythonic_fp_containers-4.0.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
10
|
-
pythonic_fp_containers-4.0.1.dist-info/METADATA,sha256=2uAe6WJXCAyaEycqhowf5zZK6e8s02NIBDy1pFhKzuY,2384
|
|
11
|
-
pythonic_fp_containers-4.0.1.dist-info/RECORD,,
|
|
File without changes
|
{pythonic_fp_containers-4.0.1.dist-info → pythonic_fp_containers-4.1.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|