astToolkit 0.7.3__tar.gz → 0.7.4__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.
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/PKG-INFO +1 -1
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_toolBe.py +1 -1
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_toolGrab.py +15 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit.egg-info/PKG-INFO +1 -1
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/pyproject.toml +1 -1
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/LICENSE +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/README.md +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/__init__.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_astTypes.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_dumpFunctionDef.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_dumpHandmade.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_prototypeFind.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_theSSOT.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_toolDOT.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_toolIfThis.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_toolMake.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_toolThen.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_toolkitAST.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_toolkitContainers.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/_toolkitNodeVisitor.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/py.typed +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit/transformationTools.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit.egg-info/SOURCES.txt +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit.egg-info/dependency_links.txt +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit.egg-info/requires.txt +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/astToolkit.egg-info/top_level.txt +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/setup.cfg +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/tests/__init__.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/tests/conftest.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/tests/dataSamples/Make.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/tests/dataSamples/__init__.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/tests/dataSamples/createTestData.py +0 -0
- {asttoolkit-0.7.3 → asttoolkit-0.7.4}/tests/test_Be.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: astToolkit
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.4
|
|
4
4
|
Summary: A powerfully composable, type-safe toolkit for Python abstract syntax tree (AST) manipulation, analysis, transformation, and code generation with a layered architecture designed for building sophisticated code processing assembly-lines.
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
6
|
License: CC-BY-NC-4.0
|
|
@@ -270,7 +270,7 @@ class Be:
|
|
|
270
270
|
|
|
271
271
|
@staticmethod
|
|
272
272
|
def AST(node: ast.AST) -> TypeIs[ast.AST]:
|
|
273
|
-
"""`Be.AST`, Abstract Syntax Tree, matches any of `class` `ast.AST` | `ast.
|
|
273
|
+
"""`Be.AST`, Abstract Syntax Tree, matches any of `class` `ast.AST` | `ast.alias` | `ast.arg` | `ast.arguments` | `ast.boolop` | `ast.cmpop` | `ast.comprehension` | `ast.excepthandler` | `ast.expr_context` | `ast.expr` | `ast.keyword` | `ast.match_case` | `ast.mod` | `ast.operator` | `ast.pattern` | `ast.slice` | `ast.stmt` | `ast.type_ignore` | `ast.type_param` | `ast.unaryop` | `ast.withitem`.
|
|
274
274
|
|
|
275
275
|
It is a subclass of `ast.object`.
|
|
276
276
|
"""
|
|
@@ -39,6 +39,21 @@ class Grab:
|
|
|
39
39
|
return node
|
|
40
40
|
return workhorse
|
|
41
41
|
|
|
42
|
+
@staticmethod
|
|
43
|
+
def index(at: int, /, action: Callable[[Any], Any]) -> Callable[[Sequence[个]], list[个]]:
|
|
44
|
+
|
|
45
|
+
def workhorse(node: Sequence[个]) -> list[个]:
|
|
46
|
+
node = list(node)
|
|
47
|
+
consequences = action(node[at])
|
|
48
|
+
if consequences is None:
|
|
49
|
+
node.pop(at)
|
|
50
|
+
elif isinstance(consequences, list):
|
|
51
|
+
node = node[0:at] + consequences + node[at + 1:None]
|
|
52
|
+
else:
|
|
53
|
+
node[at] = consequences
|
|
54
|
+
return node
|
|
55
|
+
return workhorse
|
|
56
|
+
|
|
42
57
|
@staticmethod
|
|
43
58
|
def annotationAttribute(action: Callable[[工], 工] | Callable[[工 | None], 工 | None]) -> Callable[[hasDOTannotation], hasDOTannotation]:
|
|
44
59
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: astToolkit
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.4
|
|
4
4
|
Summary: A powerfully composable, type-safe toolkit for Python abstract syntax tree (AST) manipulation, analysis, transformation, and code generation with a layered architecture designed for building sophisticated code processing assembly-lines.
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
6
|
License: CC-BY-NC-4.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "astToolkit"
|
|
3
|
-
version = "0.7.
|
|
3
|
+
version = "0.7.4"
|
|
4
4
|
description = "A powerfully composable, type-safe toolkit for Python abstract syntax tree (AST) manipulation, analysis, transformation, and code generation with a layered architecture designed for building sophisticated code processing assembly-lines."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|