pythonic-fp.containers 3.0.1__py3-none-any.whl → 4.0.1__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.
@@ -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.
@@ -12,20 +12,20 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- """Package of container like data structures.
15
+ """
16
+ Container with FP interfaces
17
+ ----------------------------
16
18
 
17
- +------------------+--------+----------------------------------------------------+
18
- | Description | Class | Package/Module |
19
- +==================+========+====================================================+
20
- | Functional tuple | FTuple | module ``pythonic_fp.containers.functional_tuple`` |
21
- +------------------+--------+----------------------------------------------------+
22
- | Immutable list | IList | module ``pythonic_fp.containers.immutable_list`` |
23
- +------------------+--------+----------------------------------------------------+
24
- | Queues | | package ``pythonic_fp.containers.queues`` |
25
- +------------------+--------+----------------------------------------------------+
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
+ +---------------------------------------------+-----------+------------------+
26
26
 
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.
@@ -15,28 +16,24 @@
15
16
  """Pythonic FP - Functional Tuple"""
16
17
 
17
18
  from collections.abc import Callable, Iterator
18
- from typing import cast, Never, overload, TypeVar, SupportsIndex
19
+ from typing import cast, Never, overload, SupportsIndex
19
20
  from pythonic_fp.iterables.folding import accumulate
20
21
  from pythonic_fp.iterables.merging import blend, concat, MergeEnum
21
22
 
22
23
  __all__ = ['FTuple']
23
24
 
24
- D = TypeVar('D', covariant=True)
25
-
26
25
 
27
26
  class FTuple[D](tuple[D, ...]):
28
- """Functional Tuple suitable for inheritance
29
-
30
- - Supports both indexing and slicing
31
- - FTuple addition and int multiplication supported
32
-
33
- - addition concatenates results, resulting in a Union type
34
- - both left and right int multiplication supported
35
- - homogeneous in its data type
36
- - supports being further inherited from
37
- - unslotted
27
+ """
28
+ .. admonition:: Functional Tuple suitable for inheritance.
38
29
 
39
- - Since these tuples are homogeneous, their covariance may be quirky
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
40
37
 
41
38
  """
42
39
 
@@ -76,13 +73,17 @@ class FTuple[D](tuple[D, ...]):
76
73
  /,
77
74
  start: L | None = None,
78
75
  default: L | None = None,
79
- ) -> L | None:
80
- """Fold Left
76
+ ) -> L:
77
+ """Fold Left with optional starting and default values.
81
78
 
82
79
  - fold left with an optional starting value
83
- - first argument of function f is for the accumulated value
80
+ - first argument of function ``f`` is for the accumulated value
84
81
 
85
- :raises ValueError: when FTuple empty and a start value not given
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.
86
87
 
87
88
  """
88
89
  it_self = iter(self)
@@ -105,13 +106,14 @@ class FTuple[D](tuple[D, ...]):
105
106
  /,
106
107
  start: R | None = None,
107
108
  default: R | None = None,
108
- ) -> R | None:
109
- """Fold Right
110
-
111
- - fold right with an optional starting value
112
- - second argument of function f is for the accumulated value
109
+ ) -> R:
110
+ """Fold Right with optional starting and default values.
113
111
 
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.
114
115
  :raises ValueError: when FTuple empty and a start value not given
116
+ :returns: The folded value if it exists, otherwise the default value.
115
117
 
116
118
  """
117
119
  it_self = reversed(self)
@@ -129,7 +131,11 @@ class FTuple[D](tuple[D, ...]):
129
131
  return acc
130
132
 
131
133
  def copy(self) -> 'FTuple[D]':
132
- """Return a shallow copy of ``FTuple`` in O(1) time & space complexity."""
134
+ """Return a shallow copy of ``FTuple`` in O(1) time & space complexity.
135
+
136
+ :returns: New ``FTuple``.
137
+
138
+ """
133
139
  return self.__class__(self)
134
140
 
135
141
  def __add__(self, other: object, /) -> tuple[D, ...]:
@@ -147,10 +153,14 @@ class FTuple[D](tuple[D, ...]):
147
153
  def accummulate[L](
148
154
  self, f: Callable[[L, D], L], s: L | None = None, /
149
155
  ) -> 'FTuple[L]':
150
- """Accumulate partial folds
156
+ """Accumulate partial folds.
157
+
158
+ Accumulate partial fold with an optional starting value,
159
+ results in an ``FTuple``.
151
160
 
152
- Accumulate partial fold results in an ``FTuple`` with an optional
153
- starting value.
161
+ :param f: Folding function used to produce partial folds.
162
+ :param s: Optional starting value.
163
+ :returns: New ``FTuple`` of the partial folds.
154
164
 
155
165
  """
156
166
  if s is None:
@@ -163,16 +173,18 @@ class FTuple[D](tuple[D, ...]):
163
173
  def bind[U](
164
174
  self,
165
175
  f: 'Callable[[D], FTuple[U]]',
166
- merge_enum: MergeEnum = MergeEnum.Concat,
176
+ merge_type: MergeEnum = MergeEnum.Concat,
167
177
  yield_partials: bool = False,
168
178
  ) -> 'FTuple[U] | Never':
169
179
  """Bind function ``f`` to the ``FTuple``.
170
180
 
171
- :param ds: values to instantiate FTuple
172
- :return: resulting FTuple
173
- :raises ValueError: if given unknown merge_type
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.
174
186
 
175
187
  """
176
188
  return FTuple(
177
- blend(*map(f, self), merge_enum=merge_enum, yield_partials=yield_partials)
189
+ blend(*map(f, self), merge_enum=merge_type, yield_partials=yield_partials)
178
190
  )
@@ -1,58 +1,22 @@
1
- # Copyright 2023-2025 Geoffrey R. Scheller
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
1
  from collections.abc import Callable, Iterator
16
- from typing import Never, overload, TypeVar, SupportsIndex
17
2
  from pythonic_fp.iterables.merging import MergeEnum
3
+ from typing import Never, SupportsIndex, overload
18
4
 
19
5
  __all__ = ['FTuple']
20
6
 
21
- D = TypeVar('D', covariant=True)
22
-
23
7
  class FTuple[D](tuple[D, ...]):
24
8
  def __reversed__(self) -> Iterator[D]: ...
25
- def __repr__(self) -> str: ...
26
- def __eq__(self, other: object, /) -> bool: ...
9
+ def __eq__(self, other: object) -> bool: ...
27
10
  @overload
28
11
  def __getitem__(self, idx: SupportsIndex) -> D: ...
29
12
  @overload
30
13
  def __getitem__(self, idx: slice) -> tuple[D, ...]: ...
31
- def foldl[L](
32
- self,
33
- f: Callable[[L, D], L],
34
- /,
35
- start: L | None = None,
36
- default: L | None = None,
37
- ) -> L | None: ...
38
- def foldr[R](
39
- self,
40
- f: Callable[[D, R], R],
41
- /,
42
- start: R | None = None,
43
- default: R | None = None,
44
- ) -> R | None: ...
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: ...
45
16
  def copy(self) -> FTuple[D]: ...
46
- def __add__(self, other: object, /) -> tuple[D, ...]: ...
17
+ def __add__(self, other: object) -> tuple[D, ...]: ...
47
18
  def __mul__(self, num: SupportsIndex) -> tuple[D, ...]: ...
48
19
  def __rmul__(self, num: SupportsIndex) -> tuple[D, ...]: ...
49
- def accummulate[L](
50
- self, f: Callable[[L, D], L], s: L | None = None, /
51
- ) -> FTuple[L]: ...
20
+ def accummulate[L](self, f: Callable[[L, D], L], s: L | None = None, /) -> FTuple[L]: ...
52
21
  def map[U](self, f: Callable[[D], U], /) -> FTuple[U]: ...
53
- def bind[U](
54
- self,
55
- f: Callable[[D], FTuple[U]],
56
- merge_enum: MergeEnum = MergeEnum.Concat,
57
- yield_partials: bool = False,
58
- ) -> FTuple[U] | Never: ...
22
+ def bind[U](self, f: Callable[[D], FTuple[U]], merge_type: MergeEnum = ..., yield_partials: bool = False) -> FTuple[U] | Never: ...
@@ -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.
@@ -12,47 +12,38 @@
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
- - hashable if elements are hashable
18
- - declared covariant in its generic datatype
19
- - hashability should be enforced by LSP tooling
20
- - hashability will be enforced at runtime
21
- - IList addition supported via concatenation
22
- - IList integer multiplication supported
23
-
24
- """
15
+ """Pythonic FP - Immutable guaranteed hashable lists."""
25
16
 
26
17
  from collections.abc import Callable, Iterable, Iterator, Hashable
27
- from typing import cast, Never, overload, TypeVar
18
+ from typing import cast, Never, overload
28
19
  from pythonic_fp.iterables.folding import accumulate
29
20
  from pythonic_fp.iterables.merging import blend, concat, MergeEnum
30
21
 
31
22
  __all__ = ['IList']
32
23
 
33
- D = TypeVar('D', covariant=True)
34
- T = TypeVar('T')
35
-
36
24
 
37
25
  class IList[D](Hashable):
38
- """Immutable List like data structure.
26
+ """
27
+ .. admonition:: Immutable List like data structure.
28
+
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
39
34
 
40
- - its method type parameters are also covariant
41
- - hashability will be enforced by LSP tooling
42
- - supports both indexing and slicing
43
- - addition concatenates results, resulting type a Union type
44
- - both left and right int multiplication supported
35
+ - addition is concatenation resulting in a union type
45
36
 
46
37
  """
47
38
 
48
39
  __slots__ = ('_ds', '_len', '_hash')
49
40
  __match_args__ = ('_ds', '_len')
50
41
 
51
- L = TypeVar('L')
52
- R = TypeVar('R')
53
- U = TypeVar('U')
54
-
55
42
  def __init__(self, *dss: Iterable[D]) -> None:
43
+ """
44
+ :param dss: 0 or 1 iterables
45
+
46
+ """
56
47
  if (size := len(dss)) > 1:
57
48
  msg = f'IList expects at most 1 iterable argument, got {size}'
58
49
  raise ValueError(msg)
@@ -112,12 +103,13 @@ class IList[D](Hashable):
112
103
  start: L | None = None,
113
104
  default: L | None = None,
114
105
  ) -> L | None:
115
- """Fold Left
106
+ """Fold Left.
116
107
 
117
- - fold left with an optional starting value
118
- - first argument of function ``f`` is for the accumulated value
119
-
120
- "raises ValueError: when empty and a start value not given
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.
121
113
 
122
114
  """
123
115
  it = iter(self._ds)
@@ -143,12 +135,13 @@ class IList[D](Hashable):
143
135
  start: R | None = None,
144
136
  default: R | None = None,
145
137
  ) -> R | None:
146
- """Fold Right
147
-
148
- - fold right with an optional starting value
149
- - second argument of function ``f`` is for the accumulated value
138
+ """Fold Right.
150
139
 
151
- "raises ValueError: when empty and a start value not given
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.
152
145
 
153
146
  """
154
147
  it = reversed(self._ds)
@@ -169,7 +162,7 @@ class IList[D](Hashable):
169
162
 
170
163
  def __add__(self, other: 'IList[D]', /) -> 'IList[D]':
171
164
  if not isinstance(other, IList):
172
- msg = 'IList being added to something not a IList'
165
+ msg = 'IList being added to something not an IList'
173
166
  raise ValueError(msg)
174
167
 
175
168
  return IList(concat(self, other))
@@ -183,10 +176,14 @@ class IList[D](Hashable):
183
176
  def accummulate[L](
184
177
  self, f: Callable[[L, D], L], s: L | None = None, /
185
178
  ) -> 'IList[L]':
186
- """Accumulate partial folds
179
+ """Accumulate partial folds.
180
+
181
+ Accumulate partial fold with an optional starting value,
182
+ results in an ``IList``.
187
183
 
188
- Accumulate partial fold results in an IList with
189
- an optional starting value.
184
+ :param f: Folding function used to produce partial folds.
185
+ :param s: Optional starting value.
186
+ :returns: New ``FTuple`` of the partial folds.
190
187
 
191
188
  """
192
189
  if s is None:
@@ -202,11 +199,13 @@ class IList[D](Hashable):
202
199
  merge_enum: MergeEnum = MergeEnum.Concat,
203
200
  yield_partials: bool = False,
204
201
  ) -> 'IList[U] | Never':
205
- """Bind function `f` to the `IList`.
202
+ """Bind function ``f`` to the ``IList``.
206
203
 
207
- :param ds: values to instantiate IList
208
- :return: resulting IList
209
- :raises ValueError: if given unknown merge_type
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.
210
209
 
211
210
  """
212
211
  return IList(
@@ -1,72 +1,28 @@
1
- # Copyright 2023-2025 Geoffrey R. Scheller
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- from collections.abc import Callable, Iterable, Iterator, Hashable
16
- from typing import Never, overload, TypeVar
1
+ from _typeshed import Incomplete
2
+ from collections.abc import Callable, Hashable, Iterable, Iterator
17
3
  from pythonic_fp.iterables.merging import MergeEnum
4
+ from typing import Never, overload
18
5
 
19
6
  __all__ = ['IList']
20
7
 
21
- D = TypeVar('D', covariant=True)
22
- T = TypeVar('T')
23
-
24
-
25
8
  class IList[D](Hashable):
26
- __slots__ = ('_ds', '_len', '_hash')
27
- __match_args__ = ('_ds', '_len')
28
-
29
- L = TypeVar('L')
30
- R = TypeVar('R')
31
- U = TypeVar('U')
32
-
9
+ __match_args__: Incomplete
33
10
  def __init__(self, *dss: Iterable[D]) -> None: ...
34
11
  def __hash__(self) -> int: ...
35
12
  def __iter__(self) -> Iterator[D]: ...
36
13
  def __reversed__(self) -> Iterator[D]: ...
37
14
  def __bool__(self) -> bool: ...
38
15
  def __len__(self) -> int: ...
39
- def __repr__(self) -> str: ...
40
- def __str__(self) -> str: ...
41
- def __eq__(self, other: object, /) -> bool: ...
16
+ def __eq__(self, other: object) -> bool: ...
42
17
  @overload
43
- def __getitem__(self, idx: int, /) -> D: ...
18
+ def __getitem__(self, idx: int) -> D: ...
44
19
  @overload
45
- def __getitem__(self, idx: slice, /) -> IList[D]: ...
46
- def foldl[L](
47
- self,
48
- f: Callable[[L, D], L],
49
- /,
50
- start: L | None = None,
51
- default: L | None = None,
52
- ) -> L | None: ...
53
- def foldr[R](
54
- self,
55
- f: Callable[[D, R], R],
56
- /,
57
- start: R | None = None,
58
- default: R | None = None,
59
- ) -> R | None: ...
60
- def __add__(self, other: IList[D], /) -> IList[D]: ...
61
- def __mul__(self, num: int, /) -> IList[D]: ...
62
- def __rmul__(self, num: int, /) -> IList[D]: ...
63
- def accummulate[L](
64
- self, f: Callable[[L, D], L], s: L | None = None, /
65
- ) -> IList[L]: ...
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]: ...
66
27
  def map[U](self, f: Callable[[D], U], /) -> IList[U]: ...
67
- def bind[U](
68
- self,
69
- f: Callable[[D], IList[U]],
70
- merge_enum: MergeEnum = MergeEnum.Concat,
71
- yield_partials: bool = False,
72
- ) -> IList[U] | Never: ...
28
+ def bind[U](self, f: Callable[[D], IList[U]], merge_enum: MergeEnum = ..., yield_partials: bool = False) -> IList[U] | Never: ...
@@ -0,0 +1,62 @@
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
+
@@ -0,0 +1,11 @@
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,,
@@ -1,31 +0,0 @@
1
- # Copyright 2023-2024 Geoffrey R. Scheller
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- """Three types of queues.
16
-
17
- +------------------------------------+-----------+--------------------------+
18
- | module | Class | description |
19
- +====================================+===========+==========================+
20
- | pythonic_fp.containers.queues.fifo | FIFOQueue | First-In-First-Out queue |
21
- +------------------------------------+-----------+--------------------------+
22
- | pythonic_fp.containers.queues.lifo | LIFOQueue | Last-In-First-Out queue |
23
- +------------------------------------+-----------+--------------------------+
24
- | pythonic_fp.containers.queues.de | DEQueue | Double-Ended queue |
25
- +------------------------------------+-----------+--------------------------+
26
-
27
- """
28
-
29
- __author__ = 'Geoffrey R. Scheller'
30
- __copyright__ = 'Copyright (c) 2023-2025 Geoffrey R. Scheller'
31
- __license__ = 'Apache License 2.0'
@@ -1,178 +0,0 @@
1
- # Copyright 2023-2025 Geoffrey R. Scheller
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- """Stateful Double-Ended (DE) Queue data structure.
16
-
17
- - O(1) pops each end
18
- - O(1) amortized pushes each end
19
- - O(1) length determination
20
- - will automatically increase storage capacity when needed
21
- - in a Boolean context, true if not empty, false if empty
22
- - neither indexable nor sliceable by design
23
-
24
- """
25
- from collections.abc import Callable, Iterable, Iterator
26
- from typing import TypeVar
27
- from pythonic_fp.circulararray.auto import CA
28
- from pythonic_fp.fptools.maybe import MayBe
29
-
30
- __all__ = ['DEQueue', 'de_queue']
31
-
32
- D = TypeVar('D')
33
-
34
-
35
- class DEQueue[D]:
36
-
37
- __slots__ = ('_ca',)
38
-
39
- def __init__(self, *dss: Iterable[D]) -> None:
40
- """Initial data in FIFO order, newest to oldest, as if
41
- pushed on from the right side.
42
-
43
- :param dss: takes up to one iterable
44
- :raises ValueError: if more than 1 iterable is given
45
-
46
- """
47
- if (size := len(dss)) > 1:
48
- msg = f'DEQueue expects at most 1 argument, got {size}'
49
- raise ValueError(msg)
50
- self._ca = CA(dss[0]) if size == 1 else CA()
51
-
52
- def __bool__(self) -> bool:
53
- return len(self._ca) > 0
54
-
55
- def __len__(self) -> int:
56
- return len(self._ca)
57
-
58
- def __eq__(self, other: object) -> bool:
59
- if not isinstance(other, DEQueue):
60
- return False
61
- return self._ca == other._ca
62
-
63
- def __iter__(self) -> Iterator[D]:
64
- return iter(list(self._ca))
65
-
66
- def __reversed__(self) -> Iterator[D]:
67
- return reversed(list(self._ca))
68
-
69
- def __repr__(self) -> str:
70
- if len(self) == 0:
71
- return 'DEQueue()'
72
- return 'DEQueue(' + ', '.join(map(repr, self._ca)) + ')'
73
-
74
- def __str__(self) -> str:
75
- return '>< ' + ' | '.join(map(str, self)) + ' ><'
76
-
77
- def copy(self) -> 'DEQueue[D]':
78
- """Shallow copy.
79
-
80
- :return: shallow copy of the DEQueue
81
-
82
- """
83
- return DEQueue(self._ca)
84
-
85
- def pushl(self, *ds: D) -> None:
86
- """Push data onto left side of DEQueue.
87
-
88
- :param ds: items to be pushed onto DEQueue from the left
89
-
90
- """
91
- self._ca.pushl(*ds)
92
-
93
- def pushr(self, *ds: D) -> None:
94
- """Push data onto right side of DEQueue.
95
-
96
- :param ds: items to be pushed onto DEQueue from the right
97
-
98
- """
99
- self._ca.pushr(*ds)
100
-
101
- def popl(self) -> MayBe[D]:
102
- """Pop next data item from left side DEQueue, if it exists.
103
-
104
- :return: MayBe of popped item if queue was not empty, empty MayBe otherwise
105
-
106
- """
107
- if self._ca:
108
- return MayBe(self._ca.popl())
109
- return MayBe()
110
-
111
- def popr(self) -> MayBe[D]:
112
- """Pop next item off right side DEQueue.
113
-
114
- :return: MayBe of popped item if queue was not empty, empty MayBe otherwise
115
-
116
- """
117
- if self._ca:
118
- return MayBe(self._ca.popr())
119
- return MayBe()
120
-
121
- def peakl(self) -> MayBe[D]:
122
- """Peak at data on left side of DEQueue.
123
-
124
- :return: MayBe of leftmost data if queue not empty, empty MayBe otherwise
125
-
126
- """
127
- if self._ca:
128
- return MayBe(self._ca[0])
129
- return MayBe()
130
-
131
- def peakr(self) -> MayBe[D]:
132
- """Peak at right side of DEQueue. Does not consume item.
133
-
134
- :return: MayBe of rightmost data if queue not empty, empty MayBe otherwise
135
-
136
- """
137
- if self._ca:
138
- return MayBe(self._ca[-1])
139
- return MayBe()
140
-
141
- def foldl[L](self, f: Callable[[L, D], L], start: L | None = None) -> MayBe[L]:
142
- """Reduces DEQueue left to right.
143
-
144
- :param f: reducing function, first argument is for accumulator
145
- :param start: optional starting value
146
- :return: MayBe of reduced value with f, empty MayBe if queue empty and no starting value given
147
-
148
- """
149
- if start is None:
150
- if not self._ca:
151
- return MayBe()
152
- return MayBe(self._ca.foldl(f, start))
153
-
154
- def foldr[R](self, f: Callable[[D, R], R], start: R | None = None) -> MayBe[R]:
155
- """Reduces DEQueue right to left.
156
-
157
- :param f: reducing function, second argument is for accumulator
158
- :param start: optional starting value
159
- :return: MayBe of reduced value with f, empty MayBe if queue empty and no starting value given
160
-
161
- """
162
- if start is None:
163
- if not self._ca:
164
- return MayBe()
165
- return MayBe(self._ca.foldr(f, start))
166
-
167
- def map[U](self, f: Callable[[D], U]) -> 'DEQueue[U]':
168
- """Map f over the DEQueue left to right, retain original order.
169
-
170
- :return: new DEQueue instance
171
-
172
- """
173
- return DEQueue(map(f, self._ca))
174
-
175
-
176
- def de_queue[D](*ds: D) -> DEQueue[D]:
177
- """DEQueue factory function."""
178
- return DEQueue(ds)
@@ -1,45 +0,0 @@
1
- # Copyright 2023-2025 Geoffrey R. Scheller
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- from collections.abc import Callable, Iterable, Iterator
16
- from typing import TypeVar
17
- from pythonic_fp.fptools.maybe import MayBe
18
-
19
- __all__ = ['DEQueue', 'de_queue']
20
-
21
- D = TypeVar('D')
22
-
23
- class DEQueue[D]:
24
- __slots__ = ('_ca',)
25
-
26
- def __init__(self, *dss: Iterable[D]) -> None: ...
27
- def __bool__(self) -> bool: ...
28
- def __len__(self) -> int: ...
29
- def __eq__(self, other: object) -> bool: ...
30
- def __iter__(self) -> Iterator[D]: ...
31
- def __reversed__(self) -> Iterator[D]: ...
32
- def __repr__(self) -> str: ...
33
- def __str__(self) -> str: ...
34
- def copy(self) -> DEQueue[D]: ...
35
- def pushl(self, *ds: D) -> None: ...
36
- def pushr(self, *ds: D) -> None: ...
37
- def popl(self) -> MayBe[D]: ...
38
- def popr(self) -> MayBe[D]: ...
39
- def peakl(self) -> MayBe[D]: ...
40
- def peakr(self) -> MayBe[D]: ...
41
- def foldl[L](self, f: Callable[[L, D], L], start: L | None = None) -> MayBe[L]: ...
42
- def foldr[R](self, f: Callable[[D, R], R], start: R | None = None) -> MayBe[R]: ...
43
- def map[U](self, f: Callable[[D], U]) -> DEQueue[U]: ...
44
-
45
- def de_queue[D](*ds: D) -> DEQueue[D]: ...
@@ -1,143 +0,0 @@
1
- # Copyright 2023-2024 Geoffrey R. Scheller
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- """Stateful First-In-First-Out (FIFO) Queue data structure.
16
-
17
- - O(1) pops
18
- - O(1) amortized pushes
19
- - in a Boolean context, true if not empty, false if empty
20
- - will automatically increase storage capacity when needed
21
- - neither indexable nor sliceable by design
22
- - O(1) length determination
23
-
24
- """
25
- from collections.abc import Callable, Iterable, Iterator
26
- from typing import TypeVar
27
- from pythonic_fp.circulararray.auto import CA
28
- from pythonic_fp.fptools.maybe import MayBe
29
-
30
- __all__ = ['FIFOQueue', 'fifo_queue']
31
-
32
- D = TypeVar('D')
33
-
34
-
35
- class FIFOQueue[D]:
36
-
37
- __slots__ = ('_ca',)
38
-
39
- def __init__(self, *dss: Iterable[D]) -> None:
40
- """Initial data in natural FIFO order, newest to oldest.
41
-
42
- :param dss: takes up to one iterable
43
- :raises ValueError: if more than 1 iterable is given
44
-
45
- """
46
- if (size := len(dss)) > 1:
47
- msg = f'FIFOQueue expects at most 1 iterable argument, got {size}'
48
- raise ValueError(msg)
49
- self._ca = CA(dss[0]) if size == 1 else CA()
50
-
51
- def __bool__(self) -> bool:
52
- return len(self._ca) > 0
53
-
54
- def __len__(self) -> int:
55
- return len(self._ca)
56
-
57
- def __eq__(self, other: object) -> bool:
58
- if not isinstance(other, FIFOQueue):
59
- return False
60
- return self._ca == other._ca
61
-
62
- def __iter__(self) -> Iterator[D]:
63
- return iter(list(self._ca))
64
-
65
- def __repr__(self) -> str:
66
- if len(self) == 0:
67
- return 'FIFOQueue()'
68
- return 'FIFOQueue(' + ', '.join(map(repr, self._ca)) + ')'
69
-
70
- def __str__(self) -> str:
71
- return '<< ' + ' < '.join(map(str, self)) + ' <<'
72
-
73
- def copy(self) -> 'FIFOQueue[D]':
74
- """Shallow copy.
75
-
76
- :return: shallow copy of the FIFOQueue
77
-
78
- """
79
- return FIFOQueue(self._ca)
80
-
81
- def push(self, *ds: D) -> None:
82
- """Push data onto FIFOQueue.
83
-
84
- :param ds: data items to be pushed onto FIFOQueue
85
-
86
- """
87
- self._ca.pushr(*ds)
88
-
89
- def pop(self) -> MayBe[D]:
90
- """Pop oldest data item off of FIFOQueue.
91
-
92
- :return: MayBe of popped data item if queue was not empty, empty MayBe otherwise
93
-
94
- """
95
- if self._ca:
96
- return MayBe(self._ca.popl())
97
- return MayBe()
98
-
99
- def peak_last_in(self) -> MayBe[D]:
100
- """Peak at newest data item on queue.
101
-
102
- :return: MayBe of newest data item on queue, empty MayBe if queue empty
103
-
104
- """
105
- if self._ca:
106
- return MayBe(self._ca[-1])
107
- return MayBe()
108
-
109
- def peak_next_out(self) -> MayBe[D]:
110
- """Peak at oldest data item on queue.
111
-
112
- :return: MayBe of oldest data item on queue, empty MayBe if queue empty
113
-
114
- """
115
- if self._ca:
116
- return MayBe(self._ca[0])
117
- return MayBe()
118
-
119
- def fold[T](self, f: Callable[[T, D], T], start: T | None = None) -> MayBe[T]:
120
- """Reduces FIFOQueue in natural FIFO Order, oldest to newest.
121
-
122
- :param f: reducing function, first argument is for accumulator
123
- :param start: optional starting value
124
- :return: MayBe of reduced value with f, empty MayBe if queue empty and no starting value given
125
-
126
- """
127
- if start is None:
128
- if not self._ca:
129
- return MayBe()
130
- return MayBe(self._ca.foldl(f, start))
131
-
132
- def map[U](self, f: Callable[[D], U]) -> 'FIFOQueue[U]':
133
- """Map f over the FIFOQueue, retain original order.
134
-
135
- :return: new FIFOQueue instance
136
-
137
- """
138
- return FIFOQueue(map(f, self._ca))
139
-
140
-
141
- def fifo_queue[D](*ds: D) -> FIFOQueue[D]:
142
- """FIFOQueue factory function."""
143
- return FIFOQueue(ds)
@@ -1,44 +0,0 @@
1
- # Copyright 2023-2024 Geoffrey R. Scheller
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- from collections.abc import Callable, Iterable, Iterator
16
- from typing import TypeVar
17
- from pythonic_fp.circulararray.auto import CA
18
- from pythonic_fp.fptools.maybe import MayBe
19
-
20
- __all__ = ['FIFOQueue', 'fifo_queue']
21
-
22
- D = TypeVar('D')
23
-
24
-
25
- class FIFOQueue[D]:
26
-
27
- __slots__ = ('_ca',)
28
-
29
- def __init__(self, *dss: Iterable[D]) -> None: ...
30
- def __bool__(self) -> bool: ...
31
- def __len__(self) -> int: ...
32
- def __eq__(self, other: object) -> bool: ...
33
- def __iter__(self) -> Iterator[D]: ...
34
- def __repr__(self) -> str: ...
35
- def __str__(self) -> str: ...
36
- def copy(self) -> FIFOQueue[D]: ...
37
- def push(self, *ds: D) -> None: ...
38
- def pop(self) -> MayBe[D]: ...
39
- def peak_last_in(self) -> MayBe[D]: ...
40
- def peak_next_out(self) -> MayBe[D]: ...
41
- def fold[T](self, f: Callable[[T, D], T], start: T | None = None) -> MayBe[T]: ...
42
- def map[U](self, f: Callable[[D], U]) -> FIFOQueue[U]: ...
43
-
44
- def fifo_queue[D](*ds: D) -> FIFOQueue[D]: ...
@@ -1,134 +0,0 @@
1
- # Copyright 2023-2024 Geoffrey R. Scheller
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- """Stateful Last-In-First-Out (LIFO) Queue data structure.
16
-
17
- - O(1) pops
18
- - O(1) amortized pushes
19
- - in a Boolean context, true if not empty, false if empty
20
- - will automatically increase storage capacity when needed
21
- - neither indexable nor sliceable by design
22
- - O(1) length determination
23
-
24
- """
25
- from collections.abc import Callable, Iterable, Iterator
26
- from typing import TypeVar
27
- from pythonic_fp.circulararray.auto import CA
28
- from pythonic_fp.fptools.function import swap
29
- from pythonic_fp.fptools.maybe import MayBe
30
-
31
- __all__ = ['LIFOQueue', 'lifo_queue']
32
-
33
- D = TypeVar('D')
34
-
35
-
36
- class LIFOQueue[D]:
37
-
38
- __slots__ = ('_ca',)
39
-
40
- def __init__(self, *dss: Iterable[D]) -> None:
41
- """Initial data in natural LIFO order, oldest to newest.
42
-
43
- :param dss: takes up to one iterable
44
- :raises ValueError: if more than 1 iterable is given
45
-
46
- """
47
- if (size := len(dss)) > 1:
48
- msg = f'LIFOQueue expects at most 1 iterable argument, got {size}'
49
- raise ValueError(msg)
50
- self._ca = CA(dss[0]) if size == 1 else CA()
51
-
52
- def __bool__(self) -> bool:
53
- return len(self._ca) > 0
54
-
55
- def __len__(self) -> int:
56
- return len(self._ca)
57
-
58
- def __eq__(self, other: object) -> bool:
59
- if not isinstance(other, LIFOQueue):
60
- return False
61
- return self._ca == other._ca
62
-
63
- def __iter__(self) -> Iterator[D]:
64
- return reversed(list(self._ca))
65
-
66
- def __repr__(self) -> str:
67
- if len(self) == 0:
68
- return 'LIFOQueue()'
69
- return 'LIFOQueue(' + ', '.join(map(repr, self._ca)) + ')'
70
-
71
- def __str__(self) -> str:
72
- return '|| ' + ' > '.join(map(str, self)) + ' ><'
73
-
74
- def copy(self) -> 'LIFOQueue[D]':
75
- """Shallow copy.
76
-
77
- :return: shallow copy of the LIFOQueue
78
-
79
- """
80
- return LIFOQueue(reversed(self._ca))
81
-
82
- def push(self, *ds: D) -> None:
83
- """Push data onto LIFOQueue.
84
-
85
- :param ds: data items to be pushed onto LIFOQueue
86
-
87
- """
88
- self._ca.pushr(*ds)
89
-
90
- def pop(self) -> MayBe[D]:
91
- """Pop newest data item off of LIFOQueue.
92
-
93
- :return: MayBe of popped data item if queue was not empty, empty MayBe otherwise
94
-
95
- """
96
- if self._ca:
97
- return MayBe(self._ca.popr())
98
- return MayBe()
99
-
100
- def peak(self) -> MayBe[D]:
101
- """Peak at newest data item on queue.
102
-
103
- :return: MayBe of newest data item on queue, empty MayBe if queue empty
104
-
105
- """
106
- if self._ca:
107
- return MayBe(self._ca[-1])
108
- return MayBe()
109
-
110
- def fold[T](self, f: Callable[[T, D], T], start: T | None = None) -> MayBe[T]:
111
- """Reduces LIFOQUEUE in natural LIFO Order, newest to oldest.
112
-
113
- :param f: reducing function, first argument is for accumulator
114
- :param start: optional starting value
115
- :return: MayBe of reduced value with f, empty MayBe if queue empty and no starting value given
116
-
117
- """
118
- if start is None:
119
- if not self._ca:
120
- return MayBe()
121
- return MayBe(self._ca.foldr(swap(f), start))
122
-
123
- def map[U](self, f: Callable[[D], U]) -> 'LIFOQueue[U]':
124
- """Map f over the LIFOQueue, retain original order.
125
-
126
- :return: new LIFOQueue instance
127
-
128
- """
129
- return LIFOQueue(reversed(CA(map(f, reversed(self._ca)))))
130
-
131
-
132
- def lifo_queue[D](*ds: D) -> LIFOQueue[D]:
133
- """LIFOQueue factory function."""
134
- return LIFOQueue(ds)
@@ -1,40 +0,0 @@
1
- # Copyright 2023-2024 Geoffrey R. Scheller
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- from collections.abc import Callable, Iterable, Iterator
16
- from typing import TypeVar
17
- from pythonic_fp.fptools.maybe import MayBe
18
-
19
- __all__ = ['LIFOQueue', 'lifo_queue']
20
-
21
- D = TypeVar('D')
22
-
23
- class LIFOQueue[D]:
24
- __slots__ = ('_ca',)
25
-
26
- def __init__(self, *dss: Iterable[D]) -> None: ...
27
- def __bool__(self) -> bool: ...
28
- def __len__(self) -> int: ...
29
- def __eq__(self, other: object) -> bool: ...
30
- def __iter__(self) -> Iterator[D]: ...
31
- def __repr__(self) -> str: ...
32
- def __str__(self) -> str: ...
33
- def copy(self) -> LIFOQueue[D]: ...
34
- def push(self, *ds: D) -> None: ...
35
- def pop(self) -> MayBe[D]: ...
36
- def peak(self) -> MayBe[D]: ...
37
- def fold[T](self, f: Callable[[T, D], T], start: T | None = None) -> MayBe[T]: ...
38
- def map[U](self, f: Callable[[D], U]) -> LIFOQueue[U]: ...
39
-
40
- def lifo_queue[D](*ds: D) -> LIFOQueue[D]: ...
@@ -1,62 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pythonic-fp-containers
3
- Version: 3.0.1
4
- Summary: Package of container like data structures.
5
- Keywords: boxes,dequeue,dqueue,fifo,functional_tuple,immutable_list,lifo,queue
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 :: 4 - Beta
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>=5.3.2
18
- Requires-Dist: pythonic-fp-fptools>=5.1.0
19
- Requires-Dist: pythonic-fp-iterables>=5.1.0
20
- Requires-Dist: pytest>=8.4.1 ; extra == "test"
21
- Requires-Dist: pythonic-fp-splitends>=1.0.1 ; extra == "test"
22
- Project-URL: Changelog, https://github.com/grscheller/pythonic-fp-containers/blob/main/CHANGELOG.rst
23
- Project-URL: Documentation, https://grscheller.github.io/pythonic-fp/containers/development/build/html/releases.html
24
- Project-URL: Homepage, https://github.com/grscheller/pythonic-fp/blob/main/README.md
25
- Project-URL: Source, https://github.com/grscheller/pythonic-fp-containers
26
- Provides-Extra: test
27
-
28
- Pythonic FP - Containers
29
- ========================
30
-
31
- PyPI project
32
- `pythonic-fp.containers <https://pypi.org/project/pythonic-fp.containers>`_.
33
-
34
- Python package of container like data structures.
35
-
36
- +------------------+------------------------------------------------------+
37
- | Description | Module |
38
- +==================+======================================================+
39
- | Functional tuple | *module* ``pythonic_fp.containers.functional_tuple`` |
40
- +------------------+------------------------------------------------------+
41
- | Immutable list | *module* ``pythonic_fp.containers.immutable_list`` |
42
- +------------------+------------------------------------------------------+
43
-
44
- **DEPRECATION WARNING:** ``pythonic_fp.fptools.box`` as been deprecated.
45
- Use ``pythonic_fp.box`` instead.
46
-
47
- This PyPI project is part of of the grscheller
48
- `pythonic-fp namespace projects <https://github.com/grscheller/pythonic-fp/blob/main/README.md>`_.
49
-
50
- Documentation
51
- -------------
52
-
53
- Documentation for this project is hosted on
54
- `GitHub Pages
55
- <https://grscheller.github.io/pythonic-fp/containers/development/build/html>`_.
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,18 +0,0 @@
1
- pythonic_fp/containers/__init__.py,sha256=D8meKk6jpSNZMgWlM_2tuoxffLgyKHeJwHkRwHJd2C8,1524
2
- pythonic_fp/containers/functional_tuple.py,sha256=k__UAhGALm-gHR8TC9DzBuASlPXeTeFYESc53JLHjl4,5636
3
- pythonic_fp/containers/functional_tuple.pyi,sha256=Ca3nLJVZqnicsJ2AJpp7sHoqYFOD4d15a5lO5xBOdYA,2030
4
- pythonic_fp/containers/immutable_list.py,sha256=qxXffc1uY3x9lHGRR4wt_0xJHAUNiT6Mb4Mupj8oF4U,6573
5
- pythonic_fp/containers/immutable_list.pyi,sha256=48WFxgkyB-JBD2qH3WIZjWfMArxkTWRs731rv87SRzA,2349
6
- pythonic_fp/containers/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- pythonic_fp/containers/queues/__init__.py,sha256=GJdzodYt32pADih2UHOiR9U4jfZ6SQSw6PsCYZ2r1wg,1459
8
- pythonic_fp/containers/queues/de.py,sha256=s7R-_SqF6AcWjfzOkqCfG816aZIa3Te0TVKs7GNOUVQ,5256
9
- pythonic_fp/containers/queues/de.pyi,sha256=BmjhyOiKk69Zh5et0vw5Btm-z5yRc1KDq9qH84O7L-A,1696
10
- pythonic_fp/containers/queues/fifo.py,sha256=4Pc75fSxmLScb4dQQ6qUdLIg_kvPU8sBxB8kudQQB48,4189
11
- pythonic_fp/containers/queues/fifo.pyi,sha256=FCXUvreC9C_4QhdnnT9o7K2cvgCcxTGp9IXv9p7hc2o,1558
12
- pythonic_fp/containers/queues/lifo.py,sha256=zjz9HEjRTmY3PkXHPcpdwTSvtbha1AGPnEa1Ez31r6g,3999
13
- pythonic_fp/containers/queues/lifo.pyi,sha256=EBS5tGedLZCHQK35xNzgOz_KJJGeMQR0KvlXQLiFbLU,1457
14
- pythonic_fp/containers/queues/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- pythonic_fp_containers-3.0.1.dist-info/licenses/LICENSE,sha256=IJMkVWQUVy-SonK6SMaMotDQ6Zb-lVi2bUTiGp1GUO8,10774
16
- pythonic_fp_containers-3.0.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
17
- pythonic_fp_containers-3.0.1.dist-info/METADATA,sha256=Qa1VF6iMX1qoL032CD-AvHegUpGzr1bAxO-lXwpT_0o,2613
18
- pythonic_fp_containers-3.0.1.dist-info/RECORD,,