pythonic-fp.splitends 3.1.0__tar.gz → 6.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pythonic_fp_splitends-3.1.0 → pythonic_fp_splitends-6.0.0}/PKG-INFO +13 -13
- {pythonic_fp_splitends-3.1.0 → pythonic_fp_splitends-6.0.0}/README.md +7 -7
- {pythonic_fp_splitends-3.1.0 → pythonic_fp_splitends-6.0.0}/pyproject.toml +17 -7
- {pythonic_fp_splitends-3.1.0 → pythonic_fp_splitends-6.0.0}/src/pythonic_fp/splitends/splitend.py +7 -5
- {pythonic_fp_splitends-3.1.0 → pythonic_fp_splitends-6.0.0}/src/pythonic_fp/splitends/splitend_node.py +5 -6
- {pythonic_fp_splitends-3.1.0 → pythonic_fp_splitends-6.0.0}/LICENSE +0 -0
- {pythonic_fp_splitends-3.1.0 → pythonic_fp_splitends-6.0.0}/src/pythonic_fp/splitends/__init__.py +0 -0
- {pythonic_fp_splitends-3.1.0 → pythonic_fp_splitends-6.0.0}/src/pythonic_fp/splitends/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythonic-fp-splitends
|
|
3
|
-
Version:
|
|
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.
|
|
19
|
-
Requires-Dist: pythonic-fp-iterables>=
|
|
20
|
-
Requires-Dist: pythonic-fp-queues>=
|
|
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
|
|
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
|
|
41
|
+
[GitHub Pages](https://grscheller.github.io/pythonic-fp-splitends).
|
|
42
42
|
|
|
43
|
-
- each
|
|
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
|
|
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
|
|
48
|
-
- bush-like datastructures can be formed using multiple
|
|
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
|
|
50
|
+
- in boolean context returns true if the `SplitEnd` is not just a "root"
|
|
51
51
|
|
|
52
52
|
## Copyright and License
|
|
53
53
|
|
|
@@ -7,22 +7,22 @@ between themselves.
|
|
|
7
7
|
PyPI project
|
|
8
8
|
[pythonic-fp.splitends](https://pypi.org/project/pythonic-fp-splitends/).
|
|
9
9
|
Part of the
|
|
10
|
-
[pythonic-fp](https://grscheller.github.io/pythonic-fp
|
|
10
|
+
[pythonic-fp](https://grscheller.github.io/pythonic-fp)
|
|
11
11
|
PyPI projects.
|
|
12
12
|
|
|
13
13
|
## Documentation
|
|
14
14
|
|
|
15
15
|
Documentation and other links for this project are hosted on
|
|
16
|
-
[GitHub Pages](https://grscheller.github.io/pythonic-fp
|
|
16
|
+
[GitHub Pages](https://grscheller.github.io/pythonic-fp-splitends).
|
|
17
17
|
|
|
18
|
-
- each
|
|
18
|
+
- each `SplitEnd` is a very simple stateful (mutable) LIFO stack
|
|
19
19
|
- data can be "extended" to or "snipped" off of the end (tip)
|
|
20
|
-
- the "root" value of a
|
|
20
|
+
- the "root" value of a `SplitEnd` is fixed and cannot be "snipped"
|
|
21
21
|
- different mutable split ends can safely share the same "tail"
|
|
22
|
-
- each
|
|
23
|
-
- bush-like datastructures can be formed using multiple
|
|
22
|
+
- each `SplitEnd` sees itself as a singularly linked list
|
|
23
|
+
- bush-like datastructures can be formed using multiple `SplitEnds`
|
|
24
24
|
- the ``SplitEnd`` copy method and ``len`` are O(1)
|
|
25
|
-
- in boolean context returns true if the
|
|
25
|
+
- in boolean context returns true if the `SplitEnd` is not just a "root"
|
|
26
26
|
|
|
27
27
|
## Copyright and License
|
|
28
28
|
|
|
@@ -4,10 +4,10 @@ build-backend = "flit_core.buildapi"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pythonic-fp-splitends"
|
|
7
|
-
version = "
|
|
7
|
+
version = "6.0.0"
|
|
8
8
|
description = "Mutable stack datastructures that can safely share data."
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.14" # floor: PEP 649/749 deferred annotations — class-level self-reference
|
|
10
|
+
requires-python = ">=3.14" # floor: PEP 649/749 deferred annotations — class-level self-reference NameErrors on <3.14
|
|
11
11
|
authors = [
|
|
12
12
|
{ name = "Geoffrey R. Scheller", email = "geoffrey@scheller.com" },
|
|
13
13
|
]
|
|
@@ -27,15 +27,15 @@ classifiers = [
|
|
|
27
27
|
"Typing :: Typed",
|
|
28
28
|
]
|
|
29
29
|
dependencies = [
|
|
30
|
-
"pythonic-fp-fptools>=6.
|
|
31
|
-
"pythonic-fp-iterables>=
|
|
32
|
-
"pythonic-fp-queues>=
|
|
30
|
+
"pythonic-fp-fptools>=6.2,<7",
|
|
31
|
+
"pythonic-fp-iterables>=6,<7",
|
|
32
|
+
"pythonic-fp-queues>=6,<7",
|
|
33
33
|
]
|
|
34
34
|
|
|
35
35
|
[project.urls]
|
|
36
36
|
Changelog = "https://github.com/grscheller/pythonic-fp-splitends/blob/main/CHANGELOG.md"
|
|
37
|
-
Documentation ="https://grscheller.github.io/pythonic-fp-splitends
|
|
38
|
-
Homepage = "https://grscheller.github.io/pythonic-fp
|
|
37
|
+
Documentation ="https://grscheller.github.io/pythonic-fp-splitends"
|
|
38
|
+
Homepage = "https://grscheller.github.io/pythonic-fp"
|
|
39
39
|
Source = "https://github.com/grscheller/pythonic-fp-splitends"
|
|
40
40
|
|
|
41
41
|
[dependency-groups]
|
|
@@ -70,10 +70,15 @@ testpaths = ["tests/"]
|
|
|
70
70
|
explicit_package_bases = true
|
|
71
71
|
local_partial_types = true
|
|
72
72
|
namespace_packages = true
|
|
73
|
+
strict = true
|
|
73
74
|
warn_redundant_casts = true
|
|
74
75
|
warn_return_any = true
|
|
75
76
|
warn_unused_configs = true
|
|
76
77
|
|
|
78
|
+
[[tool.mypy.overrides]]
|
|
79
|
+
module = ["tests.*"]
|
|
80
|
+
strict_equality = false
|
|
81
|
+
|
|
77
82
|
[tool.ruff]
|
|
78
83
|
target-version = "py314"
|
|
79
84
|
|
|
@@ -92,3 +97,8 @@ docstring-quotes = "double"
|
|
|
92
97
|
[tool.ruff.format]
|
|
93
98
|
quote-style = "single"
|
|
94
99
|
docstring-code-line-length = 72
|
|
100
|
+
|
|
101
|
+
[tool.uv.sources]
|
|
102
|
+
pythonic-fp-fptools = { path = "../pythonic-fp-fptools", editable = true }
|
|
103
|
+
pythonic-fp-iterables = { path = "../pythonic-fp-iterables", editable = true }
|
|
104
|
+
pythonic-fp-queues = { path = "../pythonic-fp-queues", editable = true }
|
{pythonic_fp_splitends-3.1.0 → pythonic_fp_splitends-6.0.0}/src/pythonic_fp/splitends/splitend.py
RENAMED
|
@@ -37,10 +37,12 @@ Class SplitEnds
|
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
39
|
from collections.abc import Callable, Iterator
|
|
40
|
-
from typing import
|
|
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
|
|
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__ = '
|
|
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]) ->
|
|
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) ->
|
|
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
|
|
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
|
-
|
|
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) ->
|
|
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,
|
|
130
|
+
def both(self) -> tuple[D, SENode[D]]:
|
|
132
131
|
"""
|
|
133
132
|
.. admonition:: both data and previous node
|
|
134
133
|
|
|
File without changes
|
{pythonic_fp_splitends-3.1.0 → pythonic_fp_splitends-6.0.0}/src/pythonic_fp/splitends/__init__.py
RENAMED
|
File without changes
|
{pythonic_fp_splitends-3.1.0 → pythonic_fp_splitends-6.0.0}/src/pythonic_fp/splitends/py.typed
RENAMED
|
File without changes
|