pythonic-fp.containers 4.0.0__tar.gz → 4.0.1__tar.gz

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.
Files changed (16) hide show
  1. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/PKG-INFO +6 -6
  2. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/README.rst +2 -2
  3. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/pyproject.toml +4 -4
  4. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/src/pythonic_fp/containers/__init__.py +3 -3
  5. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/src/pythonic_fp/containers/functional_tuple.py +16 -11
  6. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/src/pythonic_fp/containers/immutable_list.py +14 -15
  7. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/.gitignore +0 -0
  8. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/CHANGELOG.rst +0 -0
  9. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/LICENSE +0 -0
  10. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/src/pythonic_fp/containers/__init__.pyi +0 -0
  11. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/src/pythonic_fp/containers/functional_tuple.pyi +0 -0
  12. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/src/pythonic_fp/containers/immutable_list.pyi +0 -0
  13. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/src/pythonic_fp/containers/py.typed +0 -0
  14. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/tests/test_functional_tuple.py +0 -0
  15. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/tests/test_immutable_list.py +0 -0
  16. {pythonic_fp_containers-4.0.0 → pythonic_fp_containers-4.0.1}/tests/test_immutable_list_fp.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pythonic-fp-containers
3
- Version: 4.0.0
3
+ Version: 4.0.1
4
4
  Summary: Container with FP interfaces
5
5
  Keywords: functional_containers,functional_tuple,immutable_list
6
6
  Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
@@ -14,9 +14,9 @@ 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-circulararray>=6.0.0
18
- Requires-Dist: pythonic-fp-fptools>=5.1.2
19
- Requires-Dist: pythonic-fp-iterables>=5.1.2
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
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
22
  Project-URL: Documentation, https://grscheller.github.io/pythonic-fp/containers/development/build/html/
@@ -44,7 +44,7 @@ programming inspired tweaks.
44
44
 
45
45
  Part of the
46
46
  `pythonic-fp
47
- <https://grscheller.github.io/pythonic-fp/homepage/build/html/index.html>`_
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/containers/development/build/html>`_.
55
+ <https://grscheller.github.io/pythonic-fp/containers>`_.
56
56
 
57
57
  Copyright and License
58
58
  ---------------------
@@ -18,7 +18,7 @@ programming inspired tweaks.
18
18
 
19
19
  Part of the
20
20
  `pythonic-fp
21
- <https://grscheller.github.io/pythonic-fp/homepage/build/html/index.html>`_
21
+ <https://grscheller.github.io/pythonic-fp>`_
22
22
  PyPI projects.
23
23
 
24
24
  Documentation
@@ -26,7 +26,7 @@ Documentation
26
26
 
27
27
  Documentation for this project is hosted on
28
28
  `GitHub Pages
29
- <https://grscheller.github.io/pythonic-fp/containers/development/build/html>`_.
29
+ <https://grscheller.github.io/pythonic-fp/containers>`_.
30
30
 
31
31
  Copyright and License
32
32
  ---------------------
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pythonic-fp-containers"
3
- version = "4.0.0"
3
+ version = "4.0.1"
4
4
  readme = "README.rst"
5
5
  requires-python = ">=3.12"
6
6
  license = { file = "LICENSE" }
@@ -20,9 +20,9 @@ classifiers = [
20
20
  "Typing :: Typed",
21
21
  ]
22
22
  dependencies = [
23
- "pythonic-fp-circulararray>=6.0.0",
24
- "pythonic-fp-fptools>=5.1.2",
25
- "pythonic-fp-iterables>=5.1.2",
23
+ "pythonic-fp-circulararray>=6.0.1",
24
+ "pythonic-fp-fptools>=5.2.0",
25
+ "pythonic-fp-iterables>=5.1.3",
26
26
  ]
27
27
  dynamic = ["description"]
28
28
 
@@ -1,4 +1,4 @@
1
- # Copyright 2023-2025 Geoffrey R. Scheller
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.
@@ -14,7 +14,7 @@
14
14
 
15
15
  """
16
16
  Container with FP interfaces
17
- ============================
17
+ ----------------------------
18
18
 
19
19
  +---------------------------------------------+-----------+------------------+
20
20
  | module | class | description |
@@ -27,5 +27,5 @@ Container with FP interfaces
27
27
  """
28
28
 
29
29
  __author__ = 'Geoffrey R. Scheller'
30
- __copyright__ = 'Copyright (c) 2023-2025 Geoffrey R. Scheller'
30
+ __copyright__ = 'Copyright (c) 2023-2026 Geoffrey R. Scheller'
31
31
  __license__ = 'Apache License 2.0'
@@ -1,4 +1,5 @@
1
- # Copyright 2023-2025 Geoffrey R. Scheller
1
+ # Copyright 2023-2026 Geoffrey R. Scheller
2
+
2
3
  #
3
4
  # Licensed under the Apache License, Version 2.0 (the "License");
4
5
  # you may not use this file except in compliance with the License.
@@ -23,18 +24,17 @@ __all__ = ['FTuple']
23
24
 
24
25
 
25
26
  class FTuple[D](tuple[D, ...]):
26
- """Functional Tuple suitable for inheritance.
27
-
28
- - supports both indexing and slicing
29
- - int multiplication and FTuple addition supported
27
+ """
28
+ .. admonition:: Functional Tuple suitable for inheritance.
30
29
 
31
- - addition concatenates results, resulting in a Union type
32
- - both left and right int multiplication supported
33
- - homogeneous in its data type
34
- - supports being further inherited from
35
- - unslotted
30
+ - supports both indexing and slicing
31
+ - int multiplication and FTuple addition supported
32
+ - addition concatenates results, resulting in a Union type
33
+ - both left and right int multiplication supported
34
+ - homogeneous in its data type
35
+ - supports being further inherited from
36
+ - unslotted
36
37
 
37
- Since these tuples are homogeneous, their covariance may be quirky.
38
38
  """
39
39
 
40
40
  def __reversed__(self) -> Iterator[D]:
@@ -84,6 +84,7 @@ class FTuple[D](tuple[D, ...]):
84
84
  :param default: An optional default value if fold does not exist.
85
85
  :raises ValueError: When ``FTuple`` empty and a start value not given.
86
86
  :returns: The folded value if it exists, otherwise the default value.
87
+
87
88
  """
88
89
  it_self = iter(self)
89
90
  if start is not None:
@@ -113,6 +114,7 @@ class FTuple[D](tuple[D, ...]):
113
114
  :param default: An optional default value if fold does not exist.
114
115
  :raises ValueError: when FTuple empty and a start value not given
115
116
  :returns: The folded value if it exists, otherwise the default value.
117
+
116
118
  """
117
119
  it_self = reversed(self)
118
120
  if start is not None:
@@ -132,6 +134,7 @@ class FTuple[D](tuple[D, ...]):
132
134
  """Return a shallow copy of ``FTuple`` in O(1) time & space complexity.
133
135
 
134
136
  :returns: New ``FTuple``.
137
+
135
138
  """
136
139
  return self.__class__(self)
137
140
 
@@ -158,6 +161,7 @@ class FTuple[D](tuple[D, ...]):
158
161
  :param f: Folding function used to produce partial folds.
159
162
  :param s: Optional starting value.
160
163
  :returns: New ``FTuple`` of the partial folds.
164
+
161
165
  """
162
166
  if s is None:
163
167
  return FTuple(accumulate(self, f))
@@ -179,6 +183,7 @@ class FTuple[D](tuple[D, ...]):
179
183
  :param yield_partials: Yield unmatched values if ``MergeEnum`` given as merge type.
180
184
  :return: Resulting ``FTuple``.
181
185
  :raises ValueError: If given an unknown merge enumeration.
186
+
182
187
  """
183
188
  return FTuple(
184
189
  blend(*map(f, self), merge_enum=merge_type, yield_partials=yield_partials)
@@ -1,4 +1,4 @@
1
- # Copyright 2023-2025 Geoffrey R. Scheller
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.
@@ -23,15 +23,16 @@ __all__ = ['IList']
23
23
 
24
24
 
25
25
  class IList[D](Hashable):
26
- """Immutable List like data structure.
26
+ """
27
+ .. admonition:: Immutable List like data structure.
27
28
 
28
- - hashability should be enforced by LSP tooling
29
- - hashability will be enforced at runtime
30
- - its method type parameters are also covariant
31
- - supports both indexing and slicing
32
- - addition and left & right ``int`` multiplication supported
29
+ - hashability should be enforced by LSP tooling
30
+ - hashability will be enforced at runtime
31
+ - its method type parameters are also covariant
32
+ - supports both indexing and slicing
33
+ - addition and left & right ``int`` multiplication supported
33
34
 
34
- - addition is concatenation resulting in a union type
35
+ - addition is concatenation resulting in a union type
35
36
 
36
37
  """
37
38
 
@@ -41,6 +42,7 @@ class IList[D](Hashable):
41
42
  def __init__(self, *dss: Iterable[D]) -> None:
42
43
  """
43
44
  :param dss: 0 or 1 iterables
45
+
44
46
  """
45
47
  if (size := len(dss)) > 1:
46
48
  msg = f'IList expects at most 1 iterable argument, got {size}'
@@ -108,6 +110,7 @@ class IList[D](Hashable):
108
110
  :param default: Optional default value if fold does not exist.
109
111
  :returns: Folded value.
110
112
  :raises ValueError: When empty and a start value not given.
113
+
111
114
  """
112
115
  it = iter(self._ds)
113
116
  if start is not None:
@@ -139,6 +142,7 @@ class IList[D](Hashable):
139
142
  :param default: Optional default value if fold does not exist.
140
143
  :returns: Folded value.
141
144
  :raises ValueError: When empty and a start value not given.
145
+
142
146
  """
143
147
  it = reversed(self._ds)
144
148
  if start is not None:
@@ -180,6 +184,7 @@ class IList[D](Hashable):
180
184
  :param f: Folding function used to produce partial folds.
181
185
  :param s: Optional starting value.
182
186
  :returns: New ``FTuple`` of the partial folds.
187
+
183
188
  """
184
189
  if s is None:
185
190
  return IList(accumulate(self, f))
@@ -194,13 +199,6 @@ class IList[D](Hashable):
194
199
  merge_enum: MergeEnum = MergeEnum.Concat,
195
200
  yield_partials: bool = False,
196
201
  ) -> 'IList[U] | Never':
197
- """Bind function `f` to the `IList`.
198
-
199
- :param ds: values to instantiate IList
200
- :return: resulting IList
201
- :raises ValueError: if given unknown merge_type
202
-
203
- """
204
202
  """Bind function ``f`` to the ``IList``.
205
203
 
206
204
  :param f: Function ``D -> IList[U]``
@@ -208,6 +206,7 @@ class IList[D](Hashable):
208
206
  :param yield_partials: Yield unmatched values if ``MergeEnum`` given as merge type.
209
207
  :return: Resulting ``IList``.
210
208
  :raises ValueError: If given an unknown merge enumeration.
209
+
211
210
  """
212
211
  return IList(
213
212
  blend(*map(f, self), merge_enum=merge_enum, yield_partials=yield_partials)