astToolkit 0.3.7__tar.gz → 0.5.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.
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/PKG-INFO +3 -1
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/__init__.py +1 -16
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_astTypes.py +7 -6
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_toolClassIsAndAttribute.py +3 -3
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_toolDOT.py +31 -30
- asttoolkit-0.5.0/astToolkit/_toolMake.py +1186 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit.egg-info/PKG-INFO +3 -1
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit.egg-info/SOURCES.txt +0 -1
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit.egg-info/requires.txt +2 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/pyproject.toml +3 -2
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/tests/test_joinClassmethod.py +27 -43
- asttoolkit-0.3.7/astToolkit/_joinClassmethod.py +0 -677
- asttoolkit-0.3.7/astToolkit/_toolMake.py +0 -406
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/LICENSE +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/README.md +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_dumpFunctionDef.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_dumpHandmade.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_dumpHandmade.pyi +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_theSSOT.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_toolBe.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_toolGrab.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_toolIfThis.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_toolThen.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_toolkitAST.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_toolkitContainers.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_toolkitNodeVisitor.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/_types.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/py.typed +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit/transformationTools.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit.egg-info/dependency_links.txt +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/astToolkit.egg-info/top_level.txt +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/setup.cfg +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/tests/conftest.py +0 -0
- {asttoolkit-0.3.7 → asttoolkit-0.5.0}/tests/test_basic.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: astToolkit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
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
|
|
@@ -30,12 +30,14 @@ Requires-Dist: Z0Z_tools
|
|
|
30
30
|
Requires-Dist: autoflake
|
|
31
31
|
Requires-Dist: python_minifier
|
|
32
32
|
Requires-Dist: tomli
|
|
33
|
+
Requires-Dist: typing-extensions
|
|
33
34
|
Provides-Extra: testing
|
|
34
35
|
Requires-Dist: mypy; extra == "testing"
|
|
35
36
|
Requires-Dist: pytest; extra == "testing"
|
|
36
37
|
Requires-Dist: pytest-cov; extra == "testing"
|
|
37
38
|
Requires-Dist: pytest-xdist; extra == "testing"
|
|
38
39
|
Requires-Dist: pyupgrade; extra == "testing"
|
|
40
|
+
Requires-Dist: setuptools-scm; extra == "testing"
|
|
39
41
|
Requires-Dist: trove_classifiers; extra == "testing"
|
|
40
42
|
Dynamic: license-file
|
|
41
43
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
AST Toolkit for Python - A comprehensive utility library for AST manipulation and transformation
|
|
3
3
|
|
|
4
4
|
The astToolkit package provides a powerful set of tools for working with Python's Abstract Syntax Tree (AST),
|
|
5
|
-
enabling sophisticated code analysis, transformation, and generation. The toolkit is designed around a
|
|
5
|
+
enabling sophisticated code analysis, transformation, and generation. The toolkit is designed around a
|
|
6
6
|
composable architecture with specialized modules for different aspects of AST manipulation:
|
|
7
7
|
|
|
8
8
|
Core Components:
|
|
@@ -41,21 +41,6 @@ from astToolkit._toolClassIsAndAttribute import ClassIsAndAttribute as ClassIsAn
|
|
|
41
41
|
from astToolkit._toolDOT import DOT as DOT
|
|
42
42
|
from astToolkit._toolGrab import Grab as Grab
|
|
43
43
|
from astToolkit._toolMake import Make as Make
|
|
44
|
-
from astToolkit._joinClassmethod import (
|
|
45
|
-
Add as Add,
|
|
46
|
-
BitAnd as BitAnd,
|
|
47
|
-
BitOr as BitOr,
|
|
48
|
-
BitXor as BitXor,
|
|
49
|
-
Div as Div,
|
|
50
|
-
FloorDiv as FloorDiv,
|
|
51
|
-
LShift as LShift,
|
|
52
|
-
MatMult as MatMult,
|
|
53
|
-
Mod as Mod,
|
|
54
|
-
Mult as Mult,
|
|
55
|
-
Pow as Pow,
|
|
56
|
-
RShift as RShift,
|
|
57
|
-
Sub as Sub,
|
|
58
|
-
)
|
|
59
44
|
|
|
60
45
|
from astToolkit._toolIfThis import IfThis as IfThis
|
|
61
46
|
from astToolkit._toolThen import Then as Then
|
|
@@ -51,8 +51,9 @@ hasDOTcontext_expr: typing_TypeAlias = ast.withitem
|
|
|
51
51
|
hasDOTconversion: typing_TypeAlias = ast.FormattedValue
|
|
52
52
|
hasDOTctx: typing_TypeAlias = ast.Attribute | ast.List | ast.Name | ast.Starred | ast.Subscript | ast.Tuple
|
|
53
53
|
hasDOTdecorator_list: typing_TypeAlias = ast.AsyncFunctionDef | ast.ClassDef | ast.FunctionDef
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
match sys.version_info:
|
|
55
|
+
case version if version >= (3, 13):
|
|
56
|
+
hasDOTdefault_value: typing_TypeAlias = ast.ParamSpec | ast.TypeVar | ast.TypeVarTuple
|
|
56
57
|
hasDOTdefaults: typing_TypeAlias = ast.arguments
|
|
57
58
|
hasDOTelt: typing_TypeAlias = ast.GeneratorExp | ast.ListComp | ast.SetComp
|
|
58
59
|
hasDOTelts: typing_TypeAlias = ast.List | ast.Set | ast.Tuple
|
|
@@ -117,10 +118,10 @@ hasDOTslice: typing_TypeAlias = ast.Subscript
|
|
|
117
118
|
hasDOTstep: typing_TypeAlias = ast.Slice
|
|
118
119
|
hasDOTsubject: typing_TypeAlias = ast.Match
|
|
119
120
|
hasDOTtag: typing_TypeAlias = ast.TypeIgnore
|
|
121
|
+
hasDOTtarget_expr: typing_TypeAlias = ast.AsyncFor | ast.comprehension | ast.For
|
|
120
122
|
hasDOTtarget_Name: typing_TypeAlias = ast.NamedExpr
|
|
121
123
|
hasDOTtarget_NameOrAttributeOrSubscript: typing_TypeAlias = ast.AnnAssign | ast.AugAssign
|
|
122
|
-
|
|
123
|
-
hasDOTtarget: typing_TypeAlias = hasDOTtarget_Name | hasDOTtarget_NameOrAttributeOrSubscript | hasDOTtarget_expr
|
|
124
|
+
hasDOTtarget: typing_TypeAlias = hasDOTtarget_expr | hasDOTtarget_Name | hasDOTtarget_NameOrAttributeOrSubscript
|
|
124
125
|
hasDOTtargets: typing_TypeAlias = ast.Assign | ast.Delete
|
|
125
126
|
hasDOTtest: typing_TypeAlias = ast.Assert | ast.If | ast.IfExp | ast.While
|
|
126
127
|
hasDOTtype: typing_TypeAlias = ast.ExceptHandler
|
|
@@ -128,10 +129,10 @@ hasDOTtype_comment: typing_TypeAlias = ast.arg | ast.Assign | ast.AsyncFor | ast
|
|
|
128
129
|
hasDOTtype_ignores: typing_TypeAlias = ast.Module
|
|
129
130
|
hasDOTtype_params: typing_TypeAlias = ast.AsyncFunctionDef | ast.ClassDef | ast.FunctionDef | ast.TypeAlias
|
|
130
131
|
hasDOTupper: typing_TypeAlias = ast.Slice
|
|
131
|
-
hasDOTvalue_ConstantValueType: typing_TypeAlias = ast.Constant
|
|
132
132
|
hasDOTvalue_boolOrNone: typing_TypeAlias = ast.MatchSingleton
|
|
133
|
+
hasDOTvalue_ConstantValueType: typing_TypeAlias = ast.Constant
|
|
133
134
|
hasDOTvalue_expr: typing_TypeAlias = ast.Assign | ast.Attribute | ast.AugAssign | ast.Await | ast.DictComp | ast.Expr | ast.FormattedValue | ast.keyword | ast.MatchValue | ast.NamedExpr | ast.Starred | ast.Subscript | ast.TypeAlias | ast.YieldFrom
|
|
134
135
|
hasDOTvalue_exprOrNone: typing_TypeAlias = ast.AnnAssign | ast.Return | ast.Yield
|
|
135
|
-
hasDOTvalue: typing_TypeAlias =
|
|
136
|
+
hasDOTvalue: typing_TypeAlias = hasDOTvalue_boolOrNone | hasDOTvalue_ConstantValueType | hasDOTvalue_expr | hasDOTvalue_exprOrNone
|
|
136
137
|
hasDOTvalues: typing_TypeAlias = ast.BoolOp | ast.Dict | ast.JoinedStr
|
|
137
138
|
hasDOTvararg: typing_TypeAlias = ast.arguments
|
|
@@ -72,7 +72,7 @@ class ClassIsAndAttribute:
|
|
|
72
72
|
...
|
|
73
73
|
|
|
74
74
|
@staticmethod
|
|
75
|
-
def argsIs(astClass: type[hasDOTargs], attributeCondition: Callable[[ast.arguments], bool] | Callable[[
|
|
75
|
+
def argsIs(astClass: type[hasDOTargs], attributeCondition: Callable[[ast.arguments], bool] | Callable[[list[ast.arg]], bool] | Callable[[Sequence[ast.expr]], bool]) -> Callable[[ast.AST], TypeGuard[hasDOTargs] | bool]:
|
|
76
76
|
|
|
77
77
|
def workhorse(node: ast.AST) -> TypeGuard[hasDOTargs] | bool:
|
|
78
78
|
return isinstance(node, astClass) and attributeCondition(node.args)
|
|
@@ -626,7 +626,7 @@ class ClassIsAndAttribute:
|
|
|
626
626
|
...
|
|
627
627
|
|
|
628
628
|
@staticmethod
|
|
629
|
-
def targetIs(astClass: type[hasDOTtarget], attributeCondition: Callable[[ast.
|
|
629
|
+
def targetIs(astClass: type[hasDOTtarget], attributeCondition: Callable[[ast.expr], bool] | Callable[[ast.Name], bool] | Callable[[ast.Name | ast.Attribute | ast.Subscript], bool]) -> Callable[[ast.AST], TypeGuard[hasDOTtarget] | bool]:
|
|
630
630
|
|
|
631
631
|
def workhorse(node: ast.AST) -> TypeGuard[hasDOTtarget] | bool:
|
|
632
632
|
return isinstance(node, astClass) and attributeCondition(node.target)
|
|
@@ -702,7 +702,7 @@ class ClassIsAndAttribute:
|
|
|
702
702
|
...
|
|
703
703
|
|
|
704
704
|
@staticmethod
|
|
705
|
-
def valueIs(astClass: type[hasDOTvalue], attributeCondition: Callable[[ast.expr], bool] | Callable[[
|
|
705
|
+
def valueIs(astClass: type[hasDOTvalue], attributeCondition: Callable[[ast.expr], bool] | Callable[[bool], bool] | Callable[[ConstantValueType], bool]) -> Callable[[ast.AST], TypeGuard[hasDOTvalue] | bool]:
|
|
706
706
|
|
|
707
707
|
def workhorse(node: ast.AST) -> TypeGuard[hasDOTvalue] | bool:
|
|
708
708
|
return isinstance(node, astClass) and node.value is not None and attributeCondition(node.value)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# pyright: reportReturnType=false
|
|
1
2
|
# ruff: noqa: F403, F405
|
|
2
3
|
"""This file is generated automatically, so changes to this file will be lost."""
|
|
3
4
|
from astToolkit._astTypes import *
|
|
@@ -30,7 +31,7 @@ class DOT:
|
|
|
30
31
|
|
|
31
32
|
@staticmethod
|
|
32
33
|
def annotation(node: hasDOTannotation) -> ast.expr:
|
|
33
|
-
return node.annotation
|
|
34
|
+
return node.annotation
|
|
34
35
|
|
|
35
36
|
@staticmethod
|
|
36
37
|
@overload
|
|
@@ -44,7 +45,7 @@ class DOT:
|
|
|
44
45
|
|
|
45
46
|
@staticmethod
|
|
46
47
|
def arg(node: hasDOTarg) -> str:
|
|
47
|
-
return node.arg
|
|
48
|
+
return node.arg
|
|
48
49
|
|
|
49
50
|
@staticmethod
|
|
50
51
|
@overload
|
|
@@ -62,7 +63,7 @@ class DOT:
|
|
|
62
63
|
...
|
|
63
64
|
|
|
64
65
|
@staticmethod
|
|
65
|
-
def args(node: hasDOTargs) -> ast.arguments |
|
|
66
|
+
def args(node: hasDOTargs) -> ast.arguments | list[ast.arg] | Sequence[ast.expr]:
|
|
66
67
|
return node.args
|
|
67
68
|
|
|
68
69
|
@staticmethod
|
|
@@ -71,7 +72,7 @@ class DOT:
|
|
|
71
72
|
|
|
72
73
|
@staticmethod
|
|
73
74
|
def asname(node: hasDOTasname) -> str:
|
|
74
|
-
return node.asname
|
|
75
|
+
return node.asname
|
|
75
76
|
|
|
76
77
|
@staticmethod
|
|
77
78
|
def attr(node: hasDOTattr) -> str:
|
|
@@ -97,7 +98,7 @@ class DOT:
|
|
|
97
98
|
|
|
98
99
|
@staticmethod
|
|
99
100
|
def bound(node: hasDOTbound) -> ast.expr:
|
|
100
|
-
return node.bound
|
|
101
|
+
return node.bound
|
|
101
102
|
|
|
102
103
|
@staticmethod
|
|
103
104
|
def cases(node: hasDOTcases) -> Sequence[ast.match_case]:
|
|
@@ -105,7 +106,7 @@ class DOT:
|
|
|
105
106
|
|
|
106
107
|
@staticmethod
|
|
107
108
|
def cause(node: hasDOTcause) -> ast.expr:
|
|
108
|
-
return node.cause
|
|
109
|
+
return node.cause
|
|
109
110
|
|
|
110
111
|
@staticmethod
|
|
111
112
|
def cls(node: hasDOTcls) -> ast.expr:
|
|
@@ -134,7 +135,7 @@ class DOT:
|
|
|
134
135
|
|
|
135
136
|
@staticmethod
|
|
136
137
|
def default_value(node: hasDOTdefault_value) -> ast.expr:
|
|
137
|
-
return node.default_value
|
|
138
|
+
return node.default_value
|
|
138
139
|
|
|
139
140
|
@staticmethod
|
|
140
141
|
def defaults(node: hasDOTdefaults) -> Sequence[ast.expr]:
|
|
@@ -150,7 +151,7 @@ class DOT:
|
|
|
150
151
|
|
|
151
152
|
@staticmethod
|
|
152
153
|
def exc(node: hasDOTexc) -> ast.expr:
|
|
153
|
-
return node.exc
|
|
154
|
+
return node.exc
|
|
154
155
|
|
|
155
156
|
@staticmethod
|
|
156
157
|
def finalbody(node: hasDOTfinalbody) -> Sequence[ast.stmt]:
|
|
@@ -158,7 +159,7 @@ class DOT:
|
|
|
158
159
|
|
|
159
160
|
@staticmethod
|
|
160
161
|
def format_spec(node: hasDOTformat_spec) -> ast.expr:
|
|
161
|
-
return node.format_spec
|
|
162
|
+
return node.format_spec
|
|
162
163
|
|
|
163
164
|
@staticmethod
|
|
164
165
|
def func(node: hasDOTfunc) -> ast.expr:
|
|
@@ -170,7 +171,7 @@ class DOT:
|
|
|
170
171
|
|
|
171
172
|
@staticmethod
|
|
172
173
|
def guard(node: hasDOTguard) -> ast.expr:
|
|
173
|
-
return node.guard
|
|
174
|
+
return node.guard
|
|
174
175
|
|
|
175
176
|
@staticmethod
|
|
176
177
|
def handlers(node: hasDOThandlers) -> list[ast.ExceptHandler]:
|
|
@@ -212,7 +213,7 @@ class DOT:
|
|
|
212
213
|
|
|
213
214
|
@staticmethod
|
|
214
215
|
def keys(node: hasDOTkeys) -> Sequence[ast.expr]:
|
|
215
|
-
return node.keys
|
|
216
|
+
return node.keys
|
|
216
217
|
|
|
217
218
|
@staticmethod
|
|
218
219
|
def keywords(node: hasDOTkeywords) -> Sequence[ast.keyword]:
|
|
@@ -220,22 +221,22 @@ class DOT:
|
|
|
220
221
|
|
|
221
222
|
@staticmethod
|
|
222
223
|
def kind(node: hasDOTkind) -> str:
|
|
223
|
-
return node.kind
|
|
224
|
+
return node.kind
|
|
224
225
|
|
|
225
226
|
@staticmethod
|
|
226
227
|
def kw_defaults(node: hasDOTkw_defaults) -> Sequence[ast.expr]:
|
|
227
|
-
return node.kw_defaults
|
|
228
|
+
return node.kw_defaults
|
|
228
229
|
|
|
229
230
|
@staticmethod
|
|
230
231
|
def kwarg(node: hasDOTkwarg) -> ast.arg:
|
|
231
|
-
return node.kwarg
|
|
232
|
+
return node.kwarg
|
|
232
233
|
|
|
233
234
|
@staticmethod
|
|
234
235
|
def kwd_attrs(node: hasDOTkwd_attrs) -> list[str]:
|
|
235
236
|
return node.kwd_attrs
|
|
236
237
|
|
|
237
238
|
@staticmethod
|
|
238
|
-
def kwd_patterns(node: hasDOTkwd_patterns) ->
|
|
239
|
+
def kwd_patterns(node: hasDOTkwd_patterns) -> Sequence[ast.pattern]:
|
|
239
240
|
return node.kwd_patterns
|
|
240
241
|
|
|
241
242
|
@staticmethod
|
|
@@ -256,15 +257,15 @@ class DOT:
|
|
|
256
257
|
|
|
257
258
|
@staticmethod
|
|
258
259
|
def lower(node: hasDOTlower) -> ast.expr:
|
|
259
|
-
return node.lower
|
|
260
|
+
return node.lower
|
|
260
261
|
|
|
261
262
|
@staticmethod
|
|
262
263
|
def module(node: hasDOTmodule) -> str:
|
|
263
|
-
return node.module
|
|
264
|
+
return node.module
|
|
264
265
|
|
|
265
266
|
@staticmethod
|
|
266
267
|
def msg(node: hasDOTmsg) -> ast.expr:
|
|
267
|
-
return node.msg
|
|
268
|
+
return node.msg
|
|
268
269
|
|
|
269
270
|
@staticmethod
|
|
270
271
|
@overload
|
|
@@ -283,7 +284,7 @@ class DOT:
|
|
|
283
284
|
|
|
284
285
|
@staticmethod
|
|
285
286
|
def name(node: hasDOTname) -> ast.Name | str:
|
|
286
|
-
return node.name
|
|
287
|
+
return node.name
|
|
287
288
|
|
|
288
289
|
@staticmethod
|
|
289
290
|
@overload
|
|
@@ -328,7 +329,7 @@ class DOT:
|
|
|
328
329
|
|
|
329
330
|
@staticmethod
|
|
330
331
|
def optional_vars(node: hasDOToptional_vars) -> ast.expr:
|
|
331
|
-
return node.optional_vars
|
|
332
|
+
return node.optional_vars
|
|
332
333
|
|
|
333
334
|
@staticmethod
|
|
334
335
|
@overload
|
|
@@ -356,7 +357,7 @@ class DOT:
|
|
|
356
357
|
|
|
357
358
|
@staticmethod
|
|
358
359
|
def pattern(node: hasDOTpattern) -> ast.pattern:
|
|
359
|
-
return node.pattern
|
|
360
|
+
return node.pattern
|
|
360
361
|
|
|
361
362
|
@staticmethod
|
|
362
363
|
def patterns(node: hasDOTpatterns) -> Sequence[ast.pattern]:
|
|
@@ -368,7 +369,7 @@ class DOT:
|
|
|
368
369
|
|
|
369
370
|
@staticmethod
|
|
370
371
|
def rest(node: hasDOTrest) -> str:
|
|
371
|
-
return node.rest
|
|
372
|
+
return node.rest
|
|
372
373
|
|
|
373
374
|
@staticmethod
|
|
374
375
|
@overload
|
|
@@ -382,7 +383,7 @@ class DOT:
|
|
|
382
383
|
|
|
383
384
|
@staticmethod
|
|
384
385
|
def returns(node: hasDOTreturns) -> ast.expr:
|
|
385
|
-
return node.returns
|
|
386
|
+
return node.returns
|
|
386
387
|
|
|
387
388
|
@staticmethod
|
|
388
389
|
def right(node: hasDOTright) -> ast.expr:
|
|
@@ -398,7 +399,7 @@ class DOT:
|
|
|
398
399
|
|
|
399
400
|
@staticmethod
|
|
400
401
|
def step(node: hasDOTstep) -> ast.expr:
|
|
401
|
-
return node.step
|
|
402
|
+
return node.step
|
|
402
403
|
|
|
403
404
|
@staticmethod
|
|
404
405
|
def subject(node: hasDOTsubject) -> ast.expr:
|
|
@@ -424,7 +425,7 @@ class DOT:
|
|
|
424
425
|
...
|
|
425
426
|
|
|
426
427
|
@staticmethod
|
|
427
|
-
def target(node: hasDOTtarget) -> ast.
|
|
428
|
+
def target(node: hasDOTtarget) -> ast.expr | ast.Name | (ast.Name | ast.Attribute | ast.Subscript):
|
|
428
429
|
return node.target
|
|
429
430
|
|
|
430
431
|
@staticmethod
|
|
@@ -437,11 +438,11 @@ class DOT:
|
|
|
437
438
|
|
|
438
439
|
@staticmethod
|
|
439
440
|
def type(node: hasDOTtype) -> ast.expr:
|
|
440
|
-
return node.type
|
|
441
|
+
return node.type
|
|
441
442
|
|
|
442
443
|
@staticmethod
|
|
443
444
|
def type_comment(node: hasDOTtype_comment) -> str:
|
|
444
|
-
return node.type_comment
|
|
445
|
+
return node.type_comment
|
|
445
446
|
|
|
446
447
|
@staticmethod
|
|
447
448
|
def type_ignores(node: hasDOTtype_ignores) -> list[ast.TypeIgnore]:
|
|
@@ -453,7 +454,7 @@ class DOT:
|
|
|
453
454
|
|
|
454
455
|
@staticmethod
|
|
455
456
|
def upper(node: hasDOTupper) -> ast.expr:
|
|
456
|
-
return node.upper
|
|
457
|
+
return node.upper
|
|
457
458
|
|
|
458
459
|
@staticmethod
|
|
459
460
|
@overload
|
|
@@ -476,7 +477,7 @@ class DOT:
|
|
|
476
477
|
...
|
|
477
478
|
|
|
478
479
|
@staticmethod
|
|
479
|
-
def value(node: hasDOTvalue) -> ast.expr |
|
|
480
|
+
def value(node: hasDOTvalue) -> ast.expr | bool | ConstantValueType:
|
|
480
481
|
return node.value
|
|
481
482
|
|
|
482
483
|
@staticmethod
|
|
@@ -485,4 +486,4 @@ class DOT:
|
|
|
485
486
|
|
|
486
487
|
@staticmethod
|
|
487
488
|
def vararg(node: hasDOTvararg) -> ast.arg:
|
|
488
|
-
return node.vararg
|
|
489
|
+
return node.vararg
|