pythonic-fp.splitends 3.1.0__py3-none-any.whl → 6.0.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.
@@ -37,10 +37,12 @@ Class SplitEnds
37
37
  """
38
38
 
39
39
  from collections.abc import Callable, Iterator
40
- from typing import cast, Final, overload
40
+ from typing import Final, cast, overload
41
+
41
42
  from pythonic_fp.gadgets.sentinels.flavored import Sentinel
42
- from pythonic_fp.iterables.folding import reduce_left, fold_left
43
+ from pythonic_fp.iterables.folding import fold_left, reduce_left
43
44
  from pythonic_fp.queues.lifo import LIFOQueue
45
+
44
46
  from .splitend_node import SENode
45
47
 
46
48
  __all__ = ['SplitEnd']
@@ -52,7 +54,7 @@ _sentinel: Final[_Sentinel] = Sentinel(_secret_value)
52
54
 
53
55
 
54
56
  class SplitEnd[D]:
55
- __slots__ = '_end', '_root', '_count'
57
+ __slots__ = '_count', '_end', '_root'
56
58
 
57
59
  def __init__(self, *ds: D, root: SENode[D] | _Sentinel = _sentinel) -> None:
58
60
  """
@@ -259,7 +261,7 @@ class SplitEnd[D]:
259
261
  """
260
262
  return self._root
261
263
 
262
- def reroot(self, root: SENode[D]) -> 'SplitEnd[D]':
264
+ def reroot(self, root: SENode[D]) -> SplitEnd[D]:
263
265
  """
264
266
  .. admonition:: re-root SplitEnd
265
267
 
@@ -297,7 +299,7 @@ class SplitEnd[D]:
297
299
 
298
300
  return SplitEnd(*lifo, root = root)
299
301
 
300
- def split(self, *ds: D) -> 'SplitEnd[D]':
302
+ def split(self, *ds: D) -> SplitEnd[D]:
301
303
  """
302
304
  .. admonition:: split
303
305
 
@@ -36,7 +36,8 @@
36
36
  """
37
37
 
38
38
  from collections.abc import Callable, Iterator
39
- from typing import cast, Final, overload, Self
39
+ from typing import Final, Self, cast, overload
40
+
40
41
  from pythonic_fp.gadgets.sentinels.flavored import Sentinel
41
42
 
42
43
  __all__ = ['SENode']
@@ -106,9 +107,7 @@ class SENode[D]:
106
107
 
107
108
  if self._prev is not other._prev:
108
109
  return False
109
- if self._data == other._data:
110
- return True
111
- return False
110
+ return self._data == other._data
112
111
 
113
112
  def data(self) -> D:
114
113
  """
@@ -119,7 +118,7 @@ class SENode[D]:
119
118
  """
120
119
  return self._data
121
120
 
122
- def prev(self) -> Self:
121
+ def prev(self) -> SENode[D]:
123
122
  """
124
123
  .. admonition:: peak at previous node
125
124
 
@@ -128,7 +127,7 @@ class SENode[D]:
128
127
  """
129
128
  return self._prev
130
129
 
131
- def both(self) -> tuple[D, Self]:
130
+ def both(self) -> tuple[D, SENode[D]]:
132
131
  """
133
132
  .. admonition:: both data and previous node
134
133
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pythonic-fp-splitends
3
- Version: 3.1.0
3
+ Version: 6.0.0
4
4
  Summary: Mutable stack datastructures that can safely share data.
5
5
  Keywords: SplitEnd,lifo,stack
6
6
  Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
@@ -15,12 +15,12 @@ Classifier: Programming Language :: Python :: 3.14
15
15
  Classifier: Programming Language :: Python :: 3.15
16
16
  Classifier: Typing :: Typed
17
17
  License-File: LICENSE
18
- Requires-Dist: pythonic-fp-fptools>=6.1,<6.2
19
- Requires-Dist: pythonic-fp-iterables>=5.1.4,<6
20
- Requires-Dist: pythonic-fp-queues>=5.1.3,<6
18
+ Requires-Dist: pythonic-fp-fptools>=6.2,<7
19
+ Requires-Dist: pythonic-fp-iterables>=6,<7
20
+ Requires-Dist: pythonic-fp-queues>=6,<7
21
21
  Project-URL: Changelog, https://github.com/grscheller/pythonic-fp-splitends/blob/main/CHANGELOG.md
22
- Project-URL: Documentation, https://grscheller.github.io/pythonic-fp-splitends/release/html/
23
- Project-URL: Homepage, https://grscheller.github.io/pythonic-fp/
22
+ Project-URL: Documentation, https://grscheller.github.io/pythonic-fp-splitends
23
+ Project-URL: Homepage, https://grscheller.github.io/pythonic-fp
24
24
  Project-URL: Source, https://github.com/grscheller/pythonic-fp-splitends
25
25
 
26
26
  # Pythonic FP - SplitEnds
@@ -32,22 +32,22 @@ between themselves.
32
32
  PyPI project
33
33
  [pythonic-fp.splitends](https://pypi.org/project/pythonic-fp-splitends/).
34
34
  Part of the
35
- [pythonic-fp](https://grscheller.github.io/pythonic-fp/)
35
+ [pythonic-fp](https://grscheller.github.io/pythonic-fp)
36
36
  PyPI projects.
37
37
 
38
38
  ## Documentation
39
39
 
40
40
  Documentation and other links for this project are hosted on
41
- [GitHub Pages](https://grscheller.github.io/pythonic-fp/projects/splitends.html).
41
+ [GitHub Pages](https://grscheller.github.io/pythonic-fp-splitends).
42
42
 
43
- - each ``SplitEnd`` is a very simple stateful (mutable) LIFO stack
43
+ - each `SplitEnd` is a very simple stateful (mutable) LIFO stack
44
44
  - data can be "extended" to or "snipped" off of the end (tip)
45
- - the "root" value of a ``SplitEnd`` is fixed and cannot be "snipped"
45
+ - the "root" value of a `SplitEnd` is fixed and cannot be "snipped"
46
46
  - different mutable split ends can safely share the same "tail"
47
- - each ``SplitEnd`` sees itself as a singularly linked list
48
- - bush-like datastructures can be formed using multiple ``SplitEnds``
47
+ - each `SplitEnd` sees itself as a singularly linked list
48
+ - bush-like datastructures can be formed using multiple `SplitEnds`
49
49
  - the ``SplitEnd`` copy method and ``len`` are O(1)
50
- - in boolean context returns true if the ``SplitEnd`` is not just a "root"
50
+ - in boolean context returns true if the `SplitEnd` is not just a "root"
51
51
 
52
52
  ## Copyright and License
53
53
 
@@ -0,0 +1,8 @@
1
+ pythonic_fp/splitends/__init__.py,sha256=4em0AExIcd7slGzjUD5iUDiYVSHyrgQdqce0UosgBno,1893
2
+ pythonic_fp/splitends/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ pythonic_fp/splitends/splitend.py,sha256=SPuJsC4K0SQLImVklasr5YPQrpoNMU6Lx3_q_Y62mG8,10332
4
+ pythonic_fp/splitends/splitend_node.py,sha256=glJ694I78DVsUI7lSwEdU7wM15_zIKUjaW6KJAOARp8,5108
5
+ pythonic_fp_splitends-6.0.0.dist-info/licenses/LICENSE,sha256=IJMkVWQUVy-SonK6SMaMotDQ6Zb-lVi2bUTiGp1GUO8,10774
6
+ pythonic_fp_splitends-6.0.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
7
+ pythonic_fp_splitends-6.0.0.dist-info/METADATA,sha256=oTyn0P96qcS11x65pFHQCAy5FEYVrS3ziVUvkOjPpEI,2266
8
+ pythonic_fp_splitends-6.0.0.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- pythonic_fp/splitends/__init__.py,sha256=4em0AExIcd7slGzjUD5iUDiYVSHyrgQdqce0UosgBno,1893
2
- pythonic_fp/splitends/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- pythonic_fp/splitends/splitend.py,sha256=RFBsJcEh-NGRAtOizbYShNznseutIRoeOJbCeEJBxCM,10334
4
- pythonic_fp/splitends/splitend_node.py,sha256=E8MIZEDg6ZRY_0JfQnZyTD2Xek2JAg_epEu8sCzLadY,5139
5
- pythonic_fp_splitends-3.1.0.dist-info/licenses/LICENSE,sha256=IJMkVWQUVy-SonK6SMaMotDQ6Zb-lVi2bUTiGp1GUO8,10774
6
- pythonic_fp_splitends-3.1.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
7
- pythonic_fp_splitends-3.1.0.dist-info/METADATA,sha256=uPJtwQGq9okGujWDOX1HBei7AQgB4ZhiDwk0bJaN8GA,2316
8
- pythonic_fp_splitends-3.1.0.dist-info/RECORD,,