pythonic-fp.containers 4.0.1__py3-none-any.whl → 4.2.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.
@@ -13,16 +13,15 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """
16
- Container with FP interfaces
17
- ----------------------------
16
+ Containers with FP interfaces
17
+ -----------------------------
18
18
 
19
- +---------------------------------------------+-----------+------------------+
20
- | module | class | description |
21
- +=============================================+===========+==================+
22
- | ``pythonic_fp.containers.functional_tuple`` | FTuple | Functional Tuple |
23
- +---------------------------------------------+-----------+------------------+
24
- | ``pythonic_fp.containers.immutable_list`` | IList | Immutable List |
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 suitable for inheritance.
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
- """Fold Left with optional starting and default values.
94
+ """
95
+ .. admonition:: fold left
78
96
 
79
- - fold left with an optional starting value
80
- - first argument of function ``f`` is for the accumulated value
97
+ Reduce left with optional starting and default values.
81
98
 
82
- :param f: The folding function, first argument is for the accumulated value.
83
- :param start: An optional starting value.
84
- :param default: An optional default value if fold does not exist.
85
- :raises ValueError: When ``FTuple`` empty and a start value not given.
86
- :returns: The folded value if it exists, otherwise the default value.
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
- """Fold Right with optional starting and default values.
131
+ """
132
+ .. admonition:: fold right
111
133
 
112
- :param f: The folding function, second argument is for the accumulated value.
113
- :param start: An optional starting value.
114
- :param default: An optional default value if fold does not exist.
115
- :raises ValueError: when FTuple empty and a start value not given
116
- :returns: The folded value if it exists, otherwise the default value.
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
- """Return a shallow copy of ``FTuple`` in O(1) time & space complexity.
162
+ """
163
+ .. admonition:: copy
135
164
 
136
- :returns: New ``FTuple``.
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
- """Accumulate partial folds.
157
-
158
- Accumulate partial fold with an optional starting value,
159
- results in an ``FTuple``.
188
+ """
189
+ .. admonition:: accumulate partial folds
160
190
 
161
- :param f: Folding function used to produce partial folds.
162
- :param s: Optional starting value.
163
- :returns: New ``FTuple`` of the partial folds.
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
- """Bind function ``f`` to the ``FTuple``.
216
+ """
217
+ .. admonition:: bind
218
+
219
+ Flat map function ``f`` with the ``FTuple`` with different
220
+ merging strategies.
180
221
 
181
- :param f: Function ``D -> FTuple[U]``
182
- :param merge_type: ``MergeEnum`` to determine how to merge the result.
183
- :param yield_partials: Yield unmatched values if ``MergeEnum`` given as merge type.
184
- :return: Resulting ``FTuple``.
185
- :raises ValueError: If given an unknown merge enumeration.
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:: Immutable List like data structure.
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, *dss: Iterable[D]) -> None:
40
+ def __init__(self, *ds: Iterable[D]) -> None:
43
41
  """
44
- :param dss: 0 or 1 iterables
42
+ .. admonition:: init
43
+
44
+ :param ds: One optional iterable.
45
45
 
46
46
  """
47
- if (size := len(dss)) > 1:
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(dss[0]) if size == 1 else 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
- return len(self._ds)
73
-
74
- def __repr__(self) -> str:
75
- return 'immutable_list(' + ', '.join(map(repr, self)) + ')'
102
+ """
103
+ .. admonition:: len
76
104
 
77
- def __str__(self) -> str:
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
- """Fold Left.
162
+ """
163
+ .. admonition:: fold left
107
164
 
108
- :param f: Folding function, first argument is for the accumulated value.
109
- :param start: Optional starting value.
110
- :param default: Optional default value if fold does not exist.
111
- :returns: Folded value.
112
- :raises ValueError: When empty and a start value not given.
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
- """Fold Right.
197
+ """
198
+ .. admonition:: fold right
139
199
 
140
- :param f: Folding function, second argument is for the accumulated value.
141
- :param start: Optional starting value.
142
- :param default: Optional default value if fold does not exist.
143
- :returns: Folded value.
144
- :raises ValueError: When empty and a start value not given.
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
- """Accumulate partial folds.
275
+ """
276
+ .. admonition:: accumulate partial folds
180
277
 
181
- Accumulate partial fold with an optional starting value,
182
- results in an ``IList``.
278
+ Accumulate partial fold with an optional starting value,
279
+ results in an ``IList``.
183
280
 
184
- :param f: Folding function used to produce partial folds.
185
- :param s: Optional starting value.
186
- :returns: New ``FTuple`` of the partial folds.
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
- """Bind function ``f`` to the ``IList``.
203
-
204
- :param f: Function ``D -> IList[U]``
205
- :param merge_type: ``MergeEnum`` to determine how to merge the result.
206
- :param yield_partials: Yield unmatched values if ``MergeEnum`` given as merge type.
207
- :return: Resulting ``IList``.
208
- :raises ValueError: If given an unknown merge enumeration.
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(
@@ -0,0 +1,51 @@
1
+ Metadata-Version: 2.4
2
+ Name: pythonic-fp-containers
3
+ Version: 4.2.0
4
+ Summary: Containers with FP interfaces.
5
+ Keywords: functional_containers,functional_tuple,immutable_list
6
+ Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
7
+ Requires-Python: >=3.14
8
+ Description-Content-Type: text/markdown
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Framework :: Pytest
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: Python :: 3.15
16
+ Classifier: Typing :: Typed
17
+ License-File: LICENSE
18
+ Requires-Dist: pythonic-fp-circulararray>=6.2.2,<6.3
19
+ Requires-Dist: pythonic-fp-fptools>=6,<6.2
20
+ Requires-Dist: pythonic-fp-iterables>=5.1.4,<6
21
+ Project-URL: Changelog, https://github.com/grscheller/pythonic-fp-containers/blob/main/CHANGELOG.md
22
+ Project-URL: Documentation, https://grscheller.github.io/pythonic-fp-containers/release/html/
23
+ Project-URL: Homepage, https://grscheller.github.io/pythonic-fp/
24
+ Project-URL: Source, https://github.com/grscheller/pythonic-fp-containers
25
+
26
+ # Pythonic FP - Containers
27
+
28
+ Python package for containers of like data structures with functional
29
+ programming inspired tweaks.
30
+
31
+ PyPI project
32
+ [pythonic-fp-containers](https://pypi.org/project/pythonic-fp-containers).
33
+ Part of the
34
+ [pythonic-fp](https://grscheller.github.io/pythonic-fp/)
35
+ PyPI projects.
36
+
37
+ ## Documentation
38
+
39
+ Documentation and other links for this project are hosted on
40
+ [GitHub Pages](https://grscheller.github.io/pythonic-fp/projects/containers.html).
41
+
42
+ | module | class | name |
43
+ |:------ |:-----:|:---- |
44
+ | `pythonic_fp.containers.functional_tuple` | FTuple | Functional Tuple |
45
+ | `pythonic_fp.containers.immutable_list` | IList | Immutable List |
46
+
47
+ ## Copyright and License
48
+
49
+ Copyright (c) 2023-2026 Geoffrey R. Scheller. Licensed under the Apache
50
+ License, Version 2.0. See the LICENSE file for details.
51
+
@@ -0,0 +1,8 @@
1
+ pythonic_fp/containers/__init__.py,sha256=J1UvKHza0iDCR1GrVSUeps5LHsPc56xISvkbnGXOJtA,1034
2
+ pythonic_fp/containers/functional_tuple.py,sha256=3Vdg3Fri5wGDdWv4bomS7xqWLy0B_eMQuXojZhgvKYM,7498
3
+ pythonic_fp/containers/immutable_list.py,sha256=9qtSF5R7O2f-Dzji2G11CneC0BTrk3WA5EV3z2sdnms,9796
4
+ pythonic_fp/containers/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ pythonic_fp_containers-4.2.0.dist-info/licenses/LICENSE,sha256=IJMkVWQUVy-SonK6SMaMotDQ6Zb-lVi2bUTiGp1GUO8,10774
6
+ pythonic_fp_containers-4.2.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
7
+ pythonic_fp_containers-4.2.0.dist-info/METADATA,sha256=Nw5V4t8u3_rS_bruObORtjcNlSMyBThwiJpFlD0TdOw,1969
8
+ pythonic_fp_containers-4.2.0.dist-info/RECORD,,
File without changes
@@ -1,22 +0,0 @@
1
- from collections.abc import Callable, Iterator
2
- from pythonic_fp.iterables.merging import MergeEnum
3
- from typing import Never, SupportsIndex, overload
4
-
5
- __all__ = ['FTuple']
6
-
7
- class FTuple[D](tuple[D, ...]):
8
- def __reversed__(self) -> Iterator[D]: ...
9
- def __eq__(self, other: object) -> bool: ...
10
- @overload
11
- def __getitem__(self, idx: SupportsIndex) -> D: ...
12
- @overload
13
- def __getitem__(self, idx: slice) -> tuple[D, ...]: ...
14
- def foldl[L](self, f: Callable[[L, D], L], /, start: L | None = None, default: L | None = None) -> L: ...
15
- def foldr[R](self, f: Callable[[D, R], R], /, start: R | None = None, default: R | None = None) -> R: ...
16
- def copy(self) -> FTuple[D]: ...
17
- def __add__(self, other: object) -> tuple[D, ...]: ...
18
- def __mul__(self, num: SupportsIndex) -> tuple[D, ...]: ...
19
- def __rmul__(self, num: SupportsIndex) -> tuple[D, ...]: ...
20
- def accummulate[L](self, f: Callable[[L, D], L], s: L | None = None, /) -> FTuple[L]: ...
21
- def map[U](self, f: Callable[[D], U], /) -> FTuple[U]: ...
22
- def bind[U](self, f: Callable[[D], FTuple[U]], merge_type: MergeEnum = ..., yield_partials: bool = False) -> FTuple[U] | Never: ...
@@ -1,28 +0,0 @@
1
- from _typeshed import Incomplete
2
- from collections.abc import Callable, Hashable, Iterable, Iterator
3
- from pythonic_fp.iterables.merging import MergeEnum
4
- from typing import Never, overload
5
-
6
- __all__ = ['IList']
7
-
8
- class IList[D](Hashable):
9
- __match_args__: Incomplete
10
- def __init__(self, *dss: Iterable[D]) -> None: ...
11
- def __hash__(self) -> int: ...
12
- def __iter__(self) -> Iterator[D]: ...
13
- def __reversed__(self) -> Iterator[D]: ...
14
- def __bool__(self) -> bool: ...
15
- def __len__(self) -> int: ...
16
- def __eq__(self, other: object) -> bool: ...
17
- @overload
18
- def __getitem__(self, idx: int) -> D: ...
19
- @overload
20
- def __getitem__(self, idx: slice) -> IList[D]: ...
21
- def foldl[L](self, f: Callable[[L, D], L], /, start: L | None = None, default: L | None = None) -> L | None: ...
22
- def foldr[R](self, f: Callable[[D, R], R], /, start: R | None = None, default: R | None = None) -> R | None: ...
23
- def __add__(self, other: IList[D]) -> IList[D]: ...
24
- def __mul__(self, num: int) -> IList[D]: ...
25
- def __rmul__(self, num: int) -> IList[D]: ...
26
- def accummulate[L](self, f: Callable[[L, D], L], s: L | None = None, /) -> IList[L]: ...
27
- def map[U](self, f: Callable[[D], U], /) -> IList[U]: ...
28
- def bind[U](self, f: Callable[[D], IList[U]], merge_enum: MergeEnum = ..., yield_partials: bool = False) -> IList[U] | Never: ...
@@ -1,62 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pythonic-fp-containers
3
- Version: 4.0.1
4
- Summary: Container with FP interfaces
5
- Keywords: functional_containers,functional_tuple,immutable_list
6
- Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
7
- Requires-Python: >=3.12
8
- Description-Content-Type: text/x-rst
9
- Classifier: Development Status :: 3 - Alpha
10
- Classifier: Framework :: Pytest
11
- Classifier: Intended Audience :: Developers
12
- Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Operating System :: OS Independent
14
- Classifier: Programming Language :: Python :: 3.13
15
- Classifier: Typing :: Typed
16
- License-File: LICENSE
17
- Requires-Dist: pythonic-fp-circulararray>=6.0.1
18
- Requires-Dist: pythonic-fp-fptools>=5.2.0
19
- Requires-Dist: pythonic-fp-iterables>=5.1.3
20
- Requires-Dist: pytest>=8.4.1 ; extra == "test"
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/development/build/html/
23
- Project-URL: Homepage, https://grscheller.github.io/pythonic-fp/homepage/build/html/
24
- Project-URL: Source, https://github.com/grscheller/pythonic-fp-containers
25
- Provides-Extra: test
26
-
27
- Pythonic FP - Containers
28
- ========================
29
-
30
- PyPI project
31
- `pythonic-fp.containers
32
- <https://pypi.org/project/pythonic-fp.containers>`_.
33
-
34
- Python package of container like data structures with functional
35
- programming inspired tweaks.
36
-
37
- +---------------------------------------------+-----------+------------------+
38
- | module | class | name |
39
- +=============================================+===========+==================+
40
- | ``pythonic_fp.containers.functional_tuple`` | FTuple | Functional Tuple |
41
- +---------------------------------------------+-----------+------------------+
42
- | ``pythonic_fp.containers.immutable_list`` | IList | Immutable List |
43
- +---------------------------------------------+-----------+------------------+
44
-
45
- Part of the
46
- `pythonic-fp
47
- <https://grscheller.github.io/pythonic-fp>`_
48
- PyPI projects.
49
-
50
- Documentation
51
- -------------
52
-
53
- Documentation for this project is hosted on
54
- `GitHub Pages
55
- <https://grscheller.github.io/pythonic-fp/containers>`_.
56
-
57
- Copyright and License
58
- ---------------------
59
-
60
- Copyright (c) 2023-2025 Geoffrey R. Scheller. Licensed under the Apache
61
- License, Version 2.0. See the LICENSE file for details.
62
-
@@ -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,,