verysimpletree 2.0.0__tar.gz → 2.0.1__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.
- {verysimpletree-2.0.0 → verysimpletree-2.0.1}/PKG-INFO +2 -2
- {verysimpletree-2.0.0 → verysimpletree-2.0.1}/README.md +1 -1
- {verysimpletree-2.0.0 → verysimpletree-2.0.1}/pyproject.toml +1 -1
- {verysimpletree-2.0.0 → verysimpletree-2.0.1}/pyproject.toml.orig +1 -1
- {verysimpletree-2.0.0 → verysimpletree-2.0.1}/verysimpletree/tree.py +4 -5
- {verysimpletree-2.0.0 → verysimpletree-2.0.1}/verysimpletree/.coverage +0 -0
- {verysimpletree-2.0.0 → verysimpletree-2.0.1}/verysimpletree/__init__.py +0 -0
- {verysimpletree-2.0.0 → verysimpletree-2.0.1}/verysimpletree/py.typed +0 -0
- {verysimpletree-2.0.0 → verysimpletree-2.0.1}/verysimpletree/test_tree.py +0 -0
- {verysimpletree-2.0.0 → verysimpletree-2.0.1}/verysimpletree/util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: verysimpletree
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1
|
|
4
4
|
Summary: lightweight tree data structure
|
|
5
5
|
Author: Alex Gorji
|
|
6
6
|
Author-email: Alex Gorji <aligorji@hotmail.com>
|
|
@@ -51,7 +51,7 @@ To enable publishing on GitLab:
|
|
|
51
51
|
3. Add `UV_PUBLISH_TOKEN` as a masked, protected CI/CD variable containing a
|
|
52
52
|
PyPI API token scoped to the `verysimpletree` project.
|
|
53
53
|
4. Set the version in `pyproject.toml`, update `uv.lock`, and commit the changes.
|
|
54
|
-
5. Push a matching stable version tag, such as `v2.0.
|
|
54
|
+
5. Push a matching stable version tag, such as `v2.0.1`.
|
|
55
55
|
|
|
56
56
|
Publishing runs automatically only for protected stable version tags, after
|
|
57
57
|
checks, tests, and the build pass. The tag must match the package version.
|
|
@@ -33,7 +33,7 @@ To enable publishing on GitLab:
|
|
|
33
33
|
3. Add `UV_PUBLISH_TOKEN` as a masked, protected CI/CD variable containing a
|
|
34
34
|
PyPI API token scoped to the `verysimpletree` project.
|
|
35
35
|
4. Set the version in `pyproject.toml`, update `uv.lock`, and commit the changes.
|
|
36
|
-
5. Push a matching stable version tag, such as `v2.0.
|
|
36
|
+
5. Push a matching stable version tag, such as `v2.0.1`.
|
|
37
37
|
|
|
38
38
|
Publishing runs automatically only for protected stable version tags, after
|
|
39
39
|
checks, tests, and the build pass. The tag must match the package version.
|
|
@@ -20,7 +20,7 @@ class ChildNotFoundError(TreeException):
|
|
|
20
20
|
T = TypeVar("T", bound="Tree[Any]")
|
|
21
21
|
|
|
22
22
|
ValueT = TypeVar("ValueT")
|
|
23
|
-
|
|
23
|
+
TreeNodeListRepresentation = list[Union[ValueT, "TreeNodeListRepresentation[ValueT]"]]
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class Tree(ABC, Generic[T]):
|
|
@@ -218,11 +218,10 @@ class Tree(ABC, Generic[T]):
|
|
|
218
218
|
self._reset_iterators()
|
|
219
219
|
return child
|
|
220
220
|
|
|
221
|
-
# typing with T and Generic[T] etc. seems to be faulty. Return value of _create_node is Tree[T].
|
|
222
221
|
@classmethod
|
|
223
222
|
def create_tree_from_list(
|
|
224
223
|
cls,
|
|
225
|
-
tree_list_representation:
|
|
224
|
+
tree_list_representation: TreeNodeListRepresentation[list[Any]],
|
|
226
225
|
represented_attribute_names: str | list[str],
|
|
227
226
|
) -> T:
|
|
228
227
|
represented_attribute_names = make_list(represented_attribute_names)
|
|
@@ -500,13 +499,13 @@ class Tree(ABC, Generic[T]):
|
|
|
500
499
|
|
|
501
500
|
def get_list_representation(
|
|
502
501
|
self, key: Callable[["Tree[Any]"], ValueT]
|
|
503
|
-
) ->
|
|
502
|
+
) -> TreeNodeListRepresentation[ValueT]:
|
|
504
503
|
"""Return [value, child, ...], applying key to every node.
|
|
505
504
|
|
|
506
505
|
Mixed-type trees are supported. Callbacks using subclass attributes
|
|
507
506
|
must narrow the node type before accessing those attributes.
|
|
508
507
|
"""
|
|
509
|
-
result:
|
|
508
|
+
result: TreeNodeListRepresentation[ValueT] = [key(self)]
|
|
510
509
|
for child in self._children:
|
|
511
510
|
result.append(child.get_list_representation(key=key))
|
|
512
511
|
return result
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|