astToolkit 0.5.2__tar.gz → 0.5.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.5.2 → asttoolkit-0.5.4}/PKG-INFO +1 -1
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/__init__.py +7 -4
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/_astTypes.py +16 -5
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/_dumpHandmade.py +1 -1
- asttoolkit-0.5.4/astToolkit/_toolBe.py +967 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/_toolClassIsAndAttribute.py +48 -223
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/_toolDOT.py +54 -61
- asttoolkit-0.5.4/astToolkit/_toolGrab.py +658 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/_toolMake.py +568 -567
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/_toolkitAST.py +2 -4
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/_toolkitContainers.py +1 -1
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/transformationTools.py +2 -2
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit.egg-info/PKG-INFO +1 -1
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit.egg-info/SOURCES.txt +12 -1
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/pyproject.toml +1 -1
- asttoolkit-0.5.4/tests/test_astCommandLine.py +293 -0
- asttoolkit-0.5.4/tests/test_astConstant.py +220 -0
- asttoolkit-0.5.4/tests/test_astConstructors.py +415 -0
- asttoolkit-0.5.4/tests/test_astCopy.py +168 -0
- asttoolkit-0.5.4/tests/test_astCore.py +5 -0
- asttoolkit-0.5.4/tests/test_astHelpers.py +1193 -0
- asttoolkit-0.5.4/tests/test_astOptimization.py +301 -0
- asttoolkit-0.5.4/tests/test_astValidation.py +721 -0
- asttoolkit-0.5.4/tests/test_copyOperations.py +196 -0
- asttoolkit-0.5.4/tests/test_endPositions.py +339 -0
- asttoolkit-0.5.4/tests/test_nodeVisitors.py +351 -0
- asttoolkit-0.5.2/astToolkit/_toolBe.py +0 -548
- asttoolkit-0.5.2/astToolkit/_toolGrab.py +0 -661
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/LICENSE +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/README.md +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/_dumpFunctionDef.py +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/_theSSOT.py +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/_toolIfThis.py +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/_toolThen.py +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/_toolkitNodeVisitor.py +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit/py.typed +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit.egg-info/dependency_links.txt +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit.egg-info/requires.txt +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/astToolkit.egg-info/top_level.txt +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/setup.cfg +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/tests/conftest.py +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/tests/test_basic.py +0 -0
- {asttoolkit-0.5.2 → asttoolkit-0.5.4}/tests/test_joinClassmethod.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: astToolkit
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.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
|
|
@@ -14,9 +14,9 @@ from astToolkit._astTypes import (
|
|
|
14
14
|
hasDOTcases as hasDOTcases, hasDOTcause as hasDOTcause, hasDOTcls as hasDOTcls,
|
|
15
15
|
hasDOTcomparators as hasDOTcomparators, hasDOTcontext_expr as hasDOTcontext_expr,
|
|
16
16
|
hasDOTconversion as hasDOTconversion, hasDOTctx as hasDOTctx,
|
|
17
|
-
hasDOTdecorator_list as hasDOTdecorator_list,
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
hasDOTdecorator_list as hasDOTdecorator_list, hasDOTdefaults as hasDOTdefaults,
|
|
18
|
+
hasDOTelt as hasDOTelt, hasDOTelts as hasDOTelts, hasDOTexc as hasDOTexc,
|
|
19
|
+
hasDOTfinalbody as hasDOTfinalbody, hasDOTformat_spec as hasDOTformat_spec,
|
|
20
20
|
hasDOTfunc as hasDOTfunc, hasDOTgenerators as hasDOTgenerators, hasDOTguard as hasDOTguard,
|
|
21
21
|
hasDOThandlers as hasDOThandlers, hasDOTid as hasDOTid, hasDOTifs as hasDOTifs,
|
|
22
22
|
hasDOTis_async as hasDOTis_async, hasDOTitems as hasDOTitems, hasDOTiter as hasDOTiter,
|
|
@@ -50,8 +50,11 @@ from astToolkit._astTypes import (
|
|
|
50
50
|
hasDOTvalue_ConstantValueType as hasDOTvalue_ConstantValueType,
|
|
51
51
|
hasDOTvalue_expr as hasDOTvalue_expr, hasDOTvalue_exprOrNone as hasDOTvalue_exprOrNone,
|
|
52
52
|
hasDOTvalues as hasDOTvalues, hasDOTvararg as hasDOTvararg,
|
|
53
|
-
identifierDotAttribute as identifierDotAttribute, 个 as 个, 个return as 个return,
|
|
53
|
+
identifierDotAttribute as identifierDotAttribute, 一符 as 一符, 个 as 个, 个return as 个return, 二符 as 二符,
|
|
54
|
+
俪 as 俪, 口 as 口, 工 as 工, 工位 as 工位, 布尔符 as 布尔符, 常 as 常, 形 as 形, 忽 as 忽, 拦 as 拦, 木 as 木, 本 as 本,
|
|
55
|
+
比符 as 比符,
|
|
54
56
|
)
|
|
57
|
+
|
|
55
58
|
if sys.version_info >= (3, 13):
|
|
56
59
|
from astToolkit._astTypes import hasDOTdefault_value as hasDOTdefault_value
|
|
57
60
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# pyright: reportMatchNotExhaustive=false
|
|
2
1
|
"""This file is generated automatically, so changes to this file will be lost."""
|
|
3
2
|
from types import EllipsisType
|
|
4
3
|
from typing import TypeAlias as typing_TypeAlias, TypedDict, TypeVar as typing_TypeVar
|
|
@@ -7,9 +6,22 @@ import sys
|
|
|
7
6
|
|
|
8
7
|
ConstantValueType: typing_TypeAlias = bool | bytes | complex | EllipsisType | float | int | None | range | str
|
|
9
8
|
identifierDotAttribute: typing_TypeAlias = str
|
|
10
|
-
木 = typing_TypeVar('木', bound=ast.AST, covariant=True)
|
|
11
9
|
个 = typing_TypeVar('个', covariant=True)
|
|
12
10
|
个return = typing_TypeVar('个return', covariant=True)
|
|
11
|
+
木 = typing_TypeVar('木', bound=ast.AST, covariant=True)
|
|
12
|
+
布尔符 = typing_TypeVar('布尔符', bound=ast.boolop, covariant=True)
|
|
13
|
+
比符 = typing_TypeVar('比符', bound=ast.cmpop, covariant=True)
|
|
14
|
+
常 = typing_TypeVar('常', bound=ast.Constant, covariant=True)
|
|
15
|
+
拦 = typing_TypeVar('拦', bound=ast.excepthandler, covariant=True)
|
|
16
|
+
工位 = typing_TypeVar('工位', bound=ast.expr_context, covariant=True)
|
|
17
|
+
工 = typing_TypeVar('工', bound=ast.expr, covariant=True)
|
|
18
|
+
本 = typing_TypeVar('本', bound=ast.mod, covariant=True)
|
|
19
|
+
二符 = typing_TypeVar('二符', bound=ast.operator, covariant=True)
|
|
20
|
+
俪 = typing_TypeVar('俪', bound=ast.pattern, covariant=True)
|
|
21
|
+
口 = typing_TypeVar('口', bound=ast.stmt, covariant=True)
|
|
22
|
+
忽 = typing_TypeVar('忽', bound=ast.type_ignore, covariant=True)
|
|
23
|
+
形 = typing_TypeVar('形', bound=ast.type_param, covariant=True)
|
|
24
|
+
一符 = typing_TypeVar('一符', bound=ast.unaryop, covariant=True)
|
|
13
25
|
|
|
14
26
|
class _attributes(TypedDict, total=False):
|
|
15
27
|
lineno: int
|
|
@@ -51,9 +63,8 @@ hasDOTcontext_expr: typing_TypeAlias = ast.withitem
|
|
|
51
63
|
hasDOTconversion: typing_TypeAlias = ast.FormattedValue
|
|
52
64
|
hasDOTctx: typing_TypeAlias = ast.Attribute | ast.List | ast.Name | ast.Starred | ast.Subscript | ast.Tuple
|
|
53
65
|
hasDOTdecorator_list: typing_TypeAlias = ast.AsyncFunctionDef | ast.ClassDef | ast.FunctionDef
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
hasDOTdefault_value: typing_TypeAlias = ast.ParamSpec | ast.TypeVar | ast.TypeVarTuple
|
|
66
|
+
if sys.version_info >= (3, 13):
|
|
67
|
+
hasDOTdefault_value: typing_TypeAlias = ast.ParamSpec | ast.TypeVar | ast.TypeVarTuple
|
|
57
68
|
hasDOTdefaults: typing_TypeAlias = ast.arguments
|
|
58
69
|
hasDOTelt: typing_TypeAlias = ast.GeneratorExp | ast.ListComp | ast.SetComp
|
|
59
70
|
hasDOTelts: typing_TypeAlias = ast.List | ast.Set | ast.Tuple
|
|
@@ -41,7 +41,7 @@ def dump(node: AST, annotate_fields: bool = True, include_attributes: bool = Fal
|
|
|
41
41
|
continue
|
|
42
42
|
if not show_empty:
|
|
43
43
|
if value == []:
|
|
44
|
-
field_type = cls._field_types.get(name, object)
|
|
44
|
+
field_type: ConstantValueType | AST | list[AST] | list[str] = cls._field_types.get(name, object)
|
|
45
45
|
if getattr(field_type, '__origin__', ...) is list:
|
|
46
46
|
if not keywords:
|
|
47
47
|
args_buffer.append(repr(value))
|