pythonic-fp.splitends 2.0.3__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
 
@@ -0,0 +1,56 @@
1
+ Metadata-Version: 2.4
2
+ Name: pythonic-fp-splitends
3
+ Version: 6.0.0
4
+ Summary: Mutable stack datastructures that can safely share data.
5
+ Keywords: SplitEnd,lifo,stack
6
+ Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
7
+ Requires-Python: >=3.14
8
+ Description-Content-Type: text/markdown
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Framework :: Pytest
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: Python :: 3.15
16
+ Classifier: Typing :: Typed
17
+ License-File: LICENSE
18
+ Requires-Dist: pythonic-fp-fptools>=6.2,<7
19
+ Requires-Dist: pythonic-fp-iterables>=6,<7
20
+ Requires-Dist: pythonic-fp-queues>=6,<7
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
23
+ Project-URL: Homepage, https://grscheller.github.io/pythonic-fp
24
+ Project-URL: Source, https://github.com/grscheller/pythonic-fp-splitends
25
+
26
+ # Pythonic FP - SplitEnds
27
+
28
+ Package Implementing a singularly linked LIFO queue called
29
+ a `SplitEnd`. These data structures can safely share data nodes
30
+ between themselves.
31
+
32
+ PyPI project
33
+ [pythonic-fp.splitends](https://pypi.org/project/pythonic-fp-splitends/).
34
+ Part of the
35
+ [pythonic-fp](https://grscheller.github.io/pythonic-fp)
36
+ PyPI projects.
37
+
38
+ ## Documentation
39
+
40
+ Documentation and other links for this project are hosted on
41
+ [GitHub Pages](https://grscheller.github.io/pythonic-fp-splitends).
42
+
43
+ - each `SplitEnd` is a very simple stateful (mutable) LIFO stack
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"
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`
49
+ - the ``SplitEnd`` copy method and ``len`` are O(1)
50
+ - in boolean context returns true if the `SplitEnd` is not just a "root"
51
+
52
+ ## Copyright and License
53
+
54
+ Copyright (c) 2023-2026 Geoffrey R. Scheller. Licensed under the Apache
55
+ License, Version 2.0. See the LICENSE file for details.
56
+
@@ -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,,
File without changes
@@ -1,31 +0,0 @@
1
- from .splitend_node import SENode
2
- from collections.abc import Callable, Iterator
3
- from pythonic_fp.gadgets.sentinels.flavored import Sentinel
4
- from typing import overload
5
-
6
- __all__ = ['SplitEnd']
7
-
8
- type _SecretType = tuple[str, str, str]
9
- type _Sentinel = Sentinel[_SecretType]
10
- class SplitEnd[D]:
11
- def __init__(self, *ds: D, root: SENode[D] | _Sentinel = ...) -> None: ...
12
- def __iter__(self) -> Iterator[D]: ...
13
- def __reversed__(self) -> Iterator[D]: ...
14
- def __bool__(self) -> bool: ...
15
- def __len__(self) -> int: ...
16
- def __eq__(self, other: object) -> bool: ...
17
- def cut(self, num: int | None = None) -> tuple[D, ...]: ...
18
- def extend(self, *ds: D) -> None: ...
19
- def peak(self) -> D: ...
20
- def root(self) -> SENode[D]: ...
21
- def reroot(self, root: SENode[D]) -> SplitEnd[D]: ...
22
- def snip(self) -> D: ...
23
- def split(self, *ds: D) -> SplitEnd[D]: ...
24
- @overload
25
- def fold[T](self, f: Callable[[D, D], D]) -> D: ...
26
- @overload
27
- def fold[T](self, f: Callable[[T, D], T], init: T) -> T: ...
28
- @overload
29
- def rev_fold[T](self, f: Callable[[D, D], D]) -> D: ...
30
- @overload
31
- def rev_fold[T](self, f: Callable[[T, D], T], init: T) -> T: ...
@@ -1,20 +0,0 @@
1
- from collections.abc import Callable, Iterator
2
- from pythonic_fp.gadgets.sentinels.flavored import Sentinel
3
- from typing import Self, overload
4
-
5
- __all__ = ['SENode']
6
-
7
- type _Sentinel = Sentinel[str]
8
- class SENode[D]:
9
- def __init__(self, data: D, prev: Self | _Sentinel = ...) -> None: ...
10
- def __bool__(self) -> bool: ...
11
- def __iter__(self) -> Iterator[D]: ...
12
- def __eq__(self, other: object) -> bool: ...
13
- def both(self) -> tuple[D, Self]: ...
14
- def data(self) -> D: ...
15
- def prev(self) -> Self: ...
16
- def push(self, data: D) -> Self: ...
17
- @overload
18
- def fold(self, f: Callable[[D, D], D]) -> D: ...
19
- @overload
20
- def fold[T](self, f: Callable[[T, D], T], init: T) -> T: ...
@@ -1,68 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pythonic-fp-splitends
3
- Version: 2.0.3
4
- Summary: .. admonition:: Mutable stack objects that can safely share data
5
- Keywords: SplitEnd,lifo,stack
6
- Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
7
- Requires-Python: >=3.13
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.14
15
- Classifier: Typing :: Typed
16
- License-File: LICENSE
17
- Requires-Dist: pythonic-fp-fptools>=5.2.0
18
- Requires-Dist: pythonic-fp-iterables>=5.1.3
19
- Requires-Dist: pythonic-fp-queues>=5.1.1
20
- Requires-Dist: pytest>=8.4.1 ; extra == "test"
21
- Project-URL: Changelog, https://github.com/grscheller/pythonic-fp-splitends/blob/main/CHANGELOG.rst
22
- Project-URL: Documentation, https://grscheller.github.io/pythonic-fp/projects/splitends.html
23
- Project-URL: Homepage, https://grscheller.github.io/pythonic-fp/
24
- Project-URL: Source, https://github.com/grscheller/pythonic-fp-splitends
25
- Provides-Extra: test
26
-
27
- Pythonic FP - SplitEnds
28
- =======================
29
-
30
- PyPI project
31
- `pythonic-fp.splitends
32
- <https://pypi.org/project/pythonic-fp-splitends/>`_.
33
-
34
- Python package Implementing a singularly linked LIFO queue called
35
- a ``SplitEnd``. These data structures can safely share data nodes
36
- between themselves.
37
-
38
- - each ``SplitEnd`` is a very simple stateful (mutable) LIFO stack
39
- - data can be "extended" to or "snipped" off of the end (tip)
40
- - the "root" value of a ``SplitEnd`` is fixed and cannot be "snipped"
41
- - different mutable split ends can safely share the same "tail"
42
- - each ``SplitEnd`` sees itself as a singularly linked list
43
- - bush-like datastructures can be formed using multiple ``SplitEnds``
44
- - the ``SplitEnd`` copy method and ``len`` are O(1)
45
- - in boolean context returns true if the ``SplitEnd`` is not just a "root"
46
-
47
- Part of the
48
- `pythonic-fp
49
- <https://grscheller.github.io/pythonic-fp/>`_
50
- PyPI projects.
51
-
52
- Documentation
53
- -------------
54
-
55
- Documentation and other links for this project are hosted on
56
- `GitHub Pages
57
- <https://grscheller.github.io/pythonic-fp/projects/splitends.html>`_.
58
-
59
- Documentation for this project is hosted on
60
- `GitHub Pages
61
- <https://grscheller.github.io/pythonic-fp-splitends/development/html/>`_.
62
-
63
- Copyright and License
64
- ---------------------
65
-
66
- Copyright (c) 2023-2026 Geoffrey R. Scheller. Licensed under the Apache
67
- License, Version 2.0. See the LICENSE file for details.
68
-
@@ -1,11 +0,0 @@
1
- pythonic_fp/splitends/__init__.py,sha256=4em0AExIcd7slGzjUD5iUDiYVSHyrgQdqce0UosgBno,1893
2
- pythonic_fp/splitends/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- pythonic_fp/splitends/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- pythonic_fp/splitends/splitend.py,sha256=RFBsJcEh-NGRAtOizbYShNznseutIRoeOJbCeEJBxCM,10334
5
- pythonic_fp/splitends/splitend.pyi,sha256=OdTRATFXX5smbpwc8wm3gt4yyeTd_kN8VbMeNYl2Cho,1193
6
- pythonic_fp/splitends/splitend_node.py,sha256=E8MIZEDg6ZRY_0JfQnZyTD2Xek2JAg_epEu8sCzLadY,5139
7
- pythonic_fp/splitends/splitend_node.pyi,sha256=TozeGg4lmjMf0UPfZRTxRJR2kRpq0053VjbjIBUeosk,705
8
- pythonic_fp_splitends-2.0.3.dist-info/licenses/LICENSE,sha256=IJMkVWQUVy-SonK6SMaMotDQ6Zb-lVi2bUTiGp1GUO8,10774
9
- pythonic_fp_splitends-2.0.3.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
10
- pythonic_fp_splitends-2.0.3.dist-info/METADATA,sha256=PzPaGNd0cHqu3Ey8QRlUlC__RhQL3LRDLxT6mlKgzH8,2531
11
- pythonic_fp_splitends-2.0.3.dist-info/RECORD,,