pythonic-fp.containers 3.0.0__py3-none-any.whl → 3.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.
@@ -24,10 +24,6 @@
24
24
  | Queues | | package ``pythonic_fp.containers.queues`` |
25
25
  +------------------+--------+----------------------------------------------------+
26
26
 
27
- .. note::
28
-
29
- Module ``box`` has been moved to ``pythonic_fp.gadgets.box``.
30
-
31
27
  """
32
28
 
33
29
  __author__ = 'Geoffrey R. Scheller'
@@ -14,10 +14,8 @@
14
14
 
15
15
  """Pythonic FP - Functional Tuple"""
16
16
 
17
- from __future__ import annotations
18
-
19
17
  from collections.abc import Callable, Iterator
20
- from typing import cast, Never, overload, TypeVar
18
+ from typing import cast, Never, overload, TypeVar, SupportsIndex
21
19
  from pythonic_fp.iterables.folding import accumulate
22
20
  from pythonic_fp.iterables.merging import blend, concat, MergeEnum
23
21
 
@@ -25,6 +23,7 @@ __all__ = ['FTuple']
25
23
 
26
24
  D = TypeVar('D', covariant=True)
27
25
 
26
+
28
27
  class FTuple[D](tuple[D, ...]):
29
28
  """Functional Tuple suitable for inheritance
30
29
 
@@ -40,6 +39,7 @@ class FTuple[D](tuple[D, ...]):
40
39
  - Since these tuples are homogeneous, their covariance may be quirky
41
40
 
42
41
  """
42
+
43
43
  def __reversed__(self) -> Iterator[D]:
44
44
  for ii in range(len(self) - 1, -1, -1):
45
45
  yield (self[ii])
@@ -59,17 +59,14 @@ class FTuple[D](tuple[D, ...]):
59
59
  return False
60
60
  return True
61
61
 
62
- @overload # type:ignore
63
- def __getitem__(self, x: int) -> D: ...
64
62
  @overload
65
- def __getitem__(self, x: slice) -> tuple[D, ...]: ...
66
-
67
- def __getitem__(self, idx: int | slice, /) -> tuple[D, ...] | D:
68
- def newtup(tup: tuple[D, ...]) -> tuple[D, ...]:
69
- return tup[0:-1] + tup[-1:]
63
+ def __getitem__(self, idx: SupportsIndex) -> D: ...
64
+ @overload
65
+ def __getitem__(self, idx: slice) -> tuple[D, ...]: ...
70
66
 
67
+ def __getitem__(self, idx: SupportsIndex | slice) -> tuple[D, ...] | D:
71
68
  if isinstance(idx, slice):
72
- return self.__class__(newtup(super().__getitem__(idx)))
69
+ return self.__class__(super().__getitem__(idx))
73
70
  else:
74
71
  return super().__getitem__(idx)
75
72
 
@@ -131,25 +128,25 @@ class FTuple[D](tuple[D, ...]):
131
128
  acc = f(v, acc)
132
129
  return acc
133
130
 
134
- def copy(self) -> FTuple[D]:
131
+ def copy(self) -> 'FTuple[D]':
135
132
  """Return a shallow copy of ``FTuple`` in O(1) time & space complexity."""
136
133
  return self.__class__(self)
137
134
 
138
135
  def __add__(self, other: object, /) -> tuple[D, ...]:
139
- if not isinstance(other, FTuple):
136
+ if not isinstance(other, tuple):
140
137
  msg = 'FTuple being added to something not an FTuple'
141
138
  raise ValueError(msg)
142
139
  return self.__class__(concat(self, other))
143
140
 
144
- def __mul__(self, num: int, /) -> tuple[D, ...]:
141
+ def __mul__(self, num: SupportsIndex) -> tuple[D, ...]:
145
142
  return self.__class__(super().__mul__(num))
146
143
 
147
- def __rmul__(self, num: int, /) -> tuple[D]:
144
+ def __rmul__(self, num: SupportsIndex) -> tuple[D, ...]:
148
145
  return self.__class__(super().__rmul__(num))
149
146
 
150
147
  def accummulate[L](
151
148
  self, f: Callable[[L, D], L], s: L | None = None, /
152
- ) -> FTuple[L]:
149
+ ) -> 'FTuple[L]':
153
150
  """Accumulate partial folds
154
151
 
155
152
  Accumulate partial fold results in an ``FTuple`` with an optional
@@ -160,14 +157,15 @@ class FTuple[D](tuple[D, ...]):
160
157
  return FTuple(accumulate(self, f))
161
158
  return FTuple(accumulate(self, f, s))
162
159
 
163
- def map[U](self, f: Callable[[D], U], /) -> FTuple[U]:
160
+ def map[U](self, f: Callable[[D], U], /) -> 'FTuple[U]':
164
161
  return FTuple(map(f, self))
165
162
 
166
163
  def bind[U](
167
- self, f: Callable[[D], FTuple[U]],
168
- merge_enum: MergeEnum = MergeEnum.Concat,
169
- yield_partials: bool = False,
170
- ) -> FTuple[U] | Never:
164
+ self,
165
+ f: 'Callable[[D], FTuple[U]]',
166
+ merge_enum: MergeEnum = MergeEnum.Concat,
167
+ yield_partials: bool = False,
168
+ ) -> 'FTuple[U] | Never':
171
169
  """Bind function ``f`` to the ``FTuple``.
172
170
 
173
171
  :param ds: values to instantiate FTuple
@@ -176,9 +174,5 @@ class FTuple[D](tuple[D, ...]):
176
174
 
177
175
  """
178
176
  return FTuple(
179
- blend(
180
- *map(f, self),
181
- merge_enum=merge_enum,
182
- yield_partials=yield_partials
183
- )
177
+ blend(*map(f, self), merge_enum=merge_enum, yield_partials=yield_partials)
184
178
  )
@@ -0,0 +1,58 @@
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, Iterator
16
+ from typing import Never, overload, TypeVar, SupportsIndex
17
+ from pythonic_fp.iterables.merging import MergeEnum
18
+
19
+ __all__ = ['FTuple']
20
+
21
+ D = TypeVar('D', covariant=True)
22
+
23
+ class FTuple[D](tuple[D, ...]):
24
+ def __reversed__(self) -> Iterator[D]: ...
25
+ def __repr__(self) -> str: ...
26
+ def __eq__(self, other: object, /) -> bool: ...
27
+ @overload
28
+ def __getitem__(self, idx: SupportsIndex) -> D: ...
29
+ @overload
30
+ 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: ...
45
+ def copy(self) -> FTuple[D]: ...
46
+ def __add__(self, other: object, /) -> tuple[D, ...]: ...
47
+ def __mul__(self, num: SupportsIndex) -> tuple[D, ...]: ...
48
+ 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]: ...
52
+ 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: ...
@@ -23,8 +23,6 @@
23
23
 
24
24
  """
25
25
 
26
- from __future__ import annotations
27
-
28
26
  from collections.abc import Callable, Iterable, Iterator, Hashable
29
27
  from typing import cast, Never, overload, TypeVar
30
28
  from pythonic_fp.iterables.folding import accumulate
@@ -35,6 +33,7 @@ __all__ = ['IList']
35
33
  D = TypeVar('D', covariant=True)
36
34
  T = TypeVar('T')
37
35
 
36
+
38
37
  class IList[D](Hashable):
39
38
  """Immutable List like data structure.
40
39
 
@@ -45,6 +44,7 @@ class IList[D](Hashable):
45
44
  - both left and right int multiplication supported
46
45
 
47
46
  """
47
+
48
48
  __slots__ = ('_ds', '_len', '_hash')
49
49
  __match_args__ = ('_ds', '_len')
50
50
 
@@ -98,9 +98,9 @@ class IList[D](Hashable):
98
98
  @overload
99
99
  def __getitem__(self, idx: int, /) -> D: ...
100
100
  @overload
101
- def __getitem__(self, idx: slice, /) -> IList[D]: ...
101
+ def __getitem__(self, idx: slice, /) -> 'IList[D]': ...
102
102
 
103
- def __getitem__(self, idx: slice | int, /) -> IList[D] | D:
103
+ def __getitem__(self, idx: slice | int, /) -> 'IList[D] | D':
104
104
  if isinstance(idx, slice):
105
105
  return IList(self._ds[idx])
106
106
  return self._ds[idx]
@@ -116,7 +116,7 @@ class IList[D](Hashable):
116
116
 
117
117
  - fold left with an optional starting value
118
118
  - first argument of function ``f`` is for the accumulated value
119
-
119
+
120
120
  "raises ValueError: when empty and a start value not given
121
121
 
122
122
  """
@@ -167,22 +167,22 @@ class IList[D](Hashable):
167
167
  acc = f(v, acc)
168
168
  return acc
169
169
 
170
- def __add__(self, other: IList[D], /) -> IList[D]:
170
+ def __add__(self, other: 'IList[D]', /) -> 'IList[D]':
171
171
  if not isinstance(other, IList):
172
172
  msg = 'IList being added to something not a IList'
173
173
  raise ValueError(msg)
174
174
 
175
175
  return IList(concat(self, other))
176
176
 
177
- def __mul__(self, num: int, /) -> IList[D]:
177
+ def __mul__(self, num: int, /) -> 'IList[D]':
178
178
  return IList(self._ds.__mul__(num if num > 0 else 0))
179
179
 
180
- def __rmul__(self, num: int, /) -> IList[D]:
180
+ def __rmul__(self, num: int, /) -> 'IList[D]':
181
181
  return IList(self._ds.__mul__(num if num > 0 else 0))
182
182
 
183
183
  def accummulate[L](
184
184
  self, f: Callable[[L, D], L], s: L | None = None, /
185
- ) -> IList[L]:
185
+ ) -> 'IList[L]':
186
186
  """Accumulate partial folds
187
187
 
188
188
  Accumulate partial fold results in an IList with
@@ -193,15 +193,15 @@ class IList[D](Hashable):
193
193
  return IList(accumulate(self, f))
194
194
  return IList(accumulate(self, f, s))
195
195
 
196
- def map[U](self, f: Callable[[D], U], /) -> IList[U]:
196
+ def map[U](self, f: Callable[[D], U], /) -> 'IList[U]':
197
197
  return IList(map(f, self))
198
198
 
199
199
  def bind[U](
200
- self,
201
- f: Callable[[D], IList[U]],
202
- merge_enum: MergeEnum = MergeEnum.Concat,
203
- yield_partials: bool = False,
204
- ) -> IList[U] | Never:
200
+ self,
201
+ f: 'Callable[[D], IList[U]]',
202
+ merge_enum: MergeEnum = MergeEnum.Concat,
203
+ yield_partials: bool = False,
204
+ ) -> 'IList[U] | Never':
205
205
  """Bind function `f` to the `IList`.
206
206
 
207
207
  :param ds: values to instantiate IList
@@ -210,9 +210,5 @@ class IList[D](Hashable):
210
210
 
211
211
  """
212
212
  return IList(
213
- blend(
214
- *map(f, self),
215
- merge_enum=merge_enum,
216
- yield_partials=yield_partials
217
- )
213
+ blend(*map(f, self), merge_enum=merge_enum, yield_partials=yield_partials)
218
214
  )
@@ -0,0 +1,72 @@
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
17
+ from pythonic_fp.iterables.merging import MergeEnum
18
+
19
+ __all__ = ['IList']
20
+
21
+ D = TypeVar('D', covariant=True)
22
+ T = TypeVar('T')
23
+
24
+
25
+ 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
+
33
+ def __init__(self, *dss: Iterable[D]) -> None: ...
34
+ def __hash__(self) -> int: ...
35
+ def __iter__(self) -> Iterator[D]: ...
36
+ def __reversed__(self) -> Iterator[D]: ...
37
+ def __bool__(self) -> bool: ...
38
+ def __len__(self) -> int: ...
39
+ def __repr__(self) -> str: ...
40
+ def __str__(self) -> str: ...
41
+ def __eq__(self, other: object, /) -> bool: ...
42
+ @overload
43
+ def __getitem__(self, idx: int, /) -> D: ...
44
+ @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]: ...
66
+ 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: ...
@@ -22,8 +22,6 @@
22
22
  - neither indexable nor sliceable by design
23
23
 
24
24
  """
25
- from __future__ import annotations
26
-
27
25
  from collections.abc import Callable, Iterable, Iterator
28
26
  from typing import TypeVar
29
27
  from pythonic_fp.circulararray.auto import CA
@@ -76,7 +74,7 @@ class DEQueue[D]:
76
74
  def __str__(self) -> str:
77
75
  return '>< ' + ' | '.join(map(str, self)) + ' ><'
78
76
 
79
- def copy(self) -> DEQueue[D]:
77
+ def copy(self) -> 'DEQueue[D]':
80
78
  """Shallow copy.
81
79
 
82
80
  :return: shallow copy of the DEQueue
@@ -166,7 +164,7 @@ class DEQueue[D]:
166
164
  return MayBe()
167
165
  return MayBe(self._ca.foldr(f, start))
168
166
 
169
- def map[U](self, f: Callable[[D], U]) -> DEQueue[U]:
167
+ def map[U](self, f: Callable[[D], U]) -> 'DEQueue[U]':
170
168
  """Map f over the DEQueue left to right, retain original order.
171
169
 
172
170
  :return: new DEQueue instance
@@ -0,0 +1,45 @@
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]: ...
@@ -22,8 +22,6 @@
22
22
  - O(1) length determination
23
23
 
24
24
  """
25
- from __future__ import annotations
26
-
27
25
  from collections.abc import Callable, Iterable, Iterator
28
26
  from typing import TypeVar
29
27
  from pythonic_fp.circulararray.auto import CA
@@ -72,7 +70,7 @@ class FIFOQueue[D]:
72
70
  def __str__(self) -> str:
73
71
  return '<< ' + ' < '.join(map(str, self)) + ' <<'
74
72
 
75
- def copy(self) -> FIFOQueue[D]:
73
+ def copy(self) -> 'FIFOQueue[D]':
76
74
  """Shallow copy.
77
75
 
78
76
  :return: shallow copy of the FIFOQueue
@@ -131,7 +129,7 @@ class FIFOQueue[D]:
131
129
  return MayBe()
132
130
  return MayBe(self._ca.foldl(f, start))
133
131
 
134
- def map[U](self, f: Callable[[D], U]) -> FIFOQueue[U]:
132
+ def map[U](self, f: Callable[[D], U]) -> 'FIFOQueue[U]':
135
133
  """Map f over the FIFOQueue, retain original order.
136
134
 
137
135
  :return: new FIFOQueue instance
@@ -0,0 +1,44 @@
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]: ...
@@ -22,8 +22,6 @@
22
22
  - O(1) length determination
23
23
 
24
24
  """
25
- from __future__ import annotations
26
-
27
25
  from collections.abc import Callable, Iterable, Iterator
28
26
  from typing import TypeVar
29
27
  from pythonic_fp.circulararray.auto import CA
@@ -73,7 +71,7 @@ class LIFOQueue[D]:
73
71
  def __str__(self) -> str:
74
72
  return '|| ' + ' > '.join(map(str, self)) + ' ><'
75
73
 
76
- def copy(self) -> LIFOQueue[D]:
74
+ def copy(self) -> 'LIFOQueue[D]':
77
75
  """Shallow copy.
78
76
 
79
77
  :return: shallow copy of the LIFOQueue
@@ -122,7 +120,7 @@ class LIFOQueue[D]:
122
120
  return MayBe()
123
121
  return MayBe(self._ca.foldr(swap(f), start))
124
122
 
125
- def map[U](self, f: Callable[[D], U]) -> LIFOQueue[U]:
123
+ def map[U](self, f: Callable[[D], U]) -> 'LIFOQueue[U]':
126
124
  """Map f over the LIFOQueue, retain original order.
127
125
 
128
126
  :return: new LIFOQueue instance
@@ -0,0 +1,40 @@
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,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pythonic-fp-containers
3
- Version: 3.0.0
3
+ Version: 3.0.1
4
4
  Summary: Package of container like data structures.
5
- Keywords: boxes,functional_tuple,immutable_list,queue,fifo,lifo,dqueue,dequeue
5
+ Keywords: boxes,dequeue,dqueue,fifo,functional_tuple,immutable_list,lifo,queue
6
6
  Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
7
7
  Requires-Python: >=3.12
8
8
  Description-Content-Type: text/x-rst
9
- Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Development Status :: 4 - Beta
10
10
  Classifier: Framework :: Pytest
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: Apache Software License
@@ -14,12 +14,11 @@ 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>= 5.3.0
18
- Requires-Dist: pythonic-fp-fptools>=5.0.0
19
- Requires-Dist: pythonic-fp-iterables>=5.0.0
20
- Requires-Dist: pythonic-fp-singletons>=1.0.0
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
21
20
  Requires-Dist: pytest>=8.4.1 ; extra == "test"
22
- Requires-Dist: pythonic-fp-splitends>=1.0.0 ; extra == "test"
21
+ Requires-Dist: pythonic-fp-splitends>=1.0.1 ; extra == "test"
23
22
  Project-URL: Changelog, https://github.com/grscheller/pythonic-fp-containers/blob/main/CHANGELOG.rst
24
23
  Project-URL: Documentation, https://grscheller.github.io/pythonic-fp/containers/development/build/html/releases.html
25
24
  Project-URL: Homepage, https://github.com/grscheller/pythonic-fp/blob/main/README.md
@@ -37,8 +36,8 @@ Python package of container like data structures.
37
36
  +------------------+------------------------------------------------------+
38
37
  | Description | Module |
39
38
  +==================+======================================================+
40
- | Single item box | *module* ``pythonic_fp.containers.box`` |
41
39
  | Functional tuple | *module* ``pythonic_fp.containers.functional_tuple`` |
40
+ +------------------+------------------------------------------------------+
42
41
  | Immutable list | *module* ``pythonic_fp.containers.immutable_list`` |
43
42
  +------------------+------------------------------------------------------+
44
43
 
@@ -0,0 +1,18 @@
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,,
@@ -1,13 +0,0 @@
1
- pythonic_fp/containers/__init__.py,sha256=N5-djJadhpE6h8bg31AtUrqami8RPjsiUYwlwrPpYnI,1603
2
- pythonic_fp/containers/functional_tuple.py,sha256=AffGbovvg0WpnImZwzhD47djLps27Ns29eKzFosXOC4,5799
3
- pythonic_fp/containers/immutable_list.py,sha256=SGfGKRyDyBylrNn9qvpoKog531RKAusRsxhtnVa5Rps,6677
4
- pythonic_fp/containers/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- pythonic_fp/containers/queues/__init__.py,sha256=GJdzodYt32pADih2UHOiR9U4jfZ6SQSw6PsCYZ2r1wg,1459
6
- pythonic_fp/containers/queues/de.py,sha256=lBoZE8SRe6__NEFpNiqKhumDtdIVvm7S7HMojEUAL1s,5288
7
- pythonic_fp/containers/queues/fifo.py,sha256=Q9luMfZzSJzGU3aJwnJ5OIeT6hs-6ieh70b5wYGodI4,4221
8
- pythonic_fp/containers/queues/lifo.py,sha256=xudvLpEvqv9bl3bCqTiwlC2IDZ9A5kHVl-aIjNAKyeA,4031
9
- pythonic_fp/containers/queues/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- pythonic_fp_containers-3.0.0.dist-info/licenses/LICENSE,sha256=IJMkVWQUVy-SonK6SMaMotDQ6Zb-lVi2bUTiGp1GUO8,10774
11
- pythonic_fp_containers-3.0.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
12
- pythonic_fp_containers-3.0.0.dist-info/METADATA,sha256=UeoEZi26JqOUc0AYxcwpr8FrxsNEA7XOu5IMySlm_jk,2672
13
- pythonic_fp_containers-3.0.0.dist-info/RECORD,,