mapFolding 0.10.0__py3-none-any.whl → 0.11.0__py3-none-any.whl
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.
- mapFolding/__init__.py +29 -27
- mapFolding/someAssemblyRequired/Z0Z_makeSomeModules.py +4 -6
- mapFolding/someAssemblyRequired/__init__.py +15 -24
- mapFolding/someAssemblyRequired/_toolIfThis.py +4 -144
- mapFolding/someAssemblyRequired/_toolboxContainers.py +12 -284
- mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py +6 -6
- mapFolding/someAssemblyRequired/synthesizeNumbaJob.py +5 -5
- mapFolding/someAssemblyRequired/transformationTools.py +5 -178
- {mapfolding-0.10.0.dist-info → mapfolding-0.11.0.dist-info}/METADATA +2 -1
- {mapfolding-0.10.0.dist-info → mapfolding-0.11.0.dist-info}/RECORD +14 -26
- {mapfolding-0.10.0.dist-info → mapfolding-0.11.0.dist-info}/WHEEL +1 -1
- mapFolding/someAssemblyRequired/_astTypes.py +0 -117
- mapFolding/someAssemblyRequired/_theTypes.py +0 -34
- mapFolding/someAssemblyRequired/_toolBe.py +0 -524
- mapFolding/someAssemblyRequired/_toolDOT.py +0 -493
- mapFolding/someAssemblyRequired/_toolGrab.py +0 -653
- mapFolding/someAssemblyRequired/_toolMake.py +0 -339
- mapFolding/someAssemblyRequired/_toolThen.py +0 -63
- mapFolding/someAssemblyRequired/_toolboxAST.py +0 -57
- mapFolding/someAssemblyRequired/_toolboxPython.py +0 -188
- mapFolding/toolFactory/astFactory.py +0 -493
- mapFolding/toolFactory/astFactory_annex.py +0 -63
- mapFolding/toolFactory/astFactory_docstrings.py +0 -63
- {mapfolding-0.10.0.dist-info → mapfolding-0.11.0.dist-info}/entry_points.txt +0 -0
- {mapfolding-0.10.0.dist-info → mapfolding-0.11.0.dist-info}/licenses/LICENSE +0 -0
- {mapfolding-0.10.0.dist-info → mapfolding-0.11.0.dist-info}/top_level.txt +0 -0
|
@@ -1,653 +0,0 @@
|
|
|
1
|
-
"""This file is generated automatically, so changes to this file will be lost."""
|
|
2
|
-
from collections.abc import Callable, Sequence
|
|
3
|
-
from mapFolding import astDOTParamSpec, astDOTTryStar, astDOTTypeAlias, astDOTTypeVar, astDOTTypeVarTuple, astDOTtype_param
|
|
4
|
-
from mapFolding.someAssemblyRequired import ast_Identifier, ast_expr_Slice, NodeORattribute, ImaCallToName
|
|
5
|
-
from mapFolding.someAssemblyRequired._astTypes import *
|
|
6
|
-
from typing import Any, Literal
|
|
7
|
-
import ast
|
|
8
|
-
'# ruff: noqa: F405'
|
|
9
|
-
|
|
10
|
-
class Grab:
|
|
11
|
-
"""
|
|
12
|
-
Modify specific attributes of AST nodes while preserving the node structure.
|
|
13
|
-
|
|
14
|
-
The grab class provides static methods that create transformation functions to modify specific attributes of AST
|
|
15
|
-
nodes. Unlike DOT which provides read-only access, grab allows for targeted modifications of node attributes without
|
|
16
|
-
replacing the entire node.
|
|
17
|
-
|
|
18
|
-
Each method returns a function that takes a node, applies a transformation to a specific attribute of that node, and
|
|
19
|
-
returns the modified node. This enables fine-grained control when transforming AST structures.
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
@staticmethod
|
|
23
|
-
def annotationAttribute(action: Callable[[ast.expr | (ast.expr | None)], ast.expr | (ast.expr | None)]) -> Callable[[hasDOTannotation], hasDOTannotation]:
|
|
24
|
-
|
|
25
|
-
def workhorse(node: hasDOTannotation) -> hasDOTannotation:
|
|
26
|
-
node.annotation = action(node.annotation)
|
|
27
|
-
return node
|
|
28
|
-
return workhorse
|
|
29
|
-
|
|
30
|
-
@staticmethod
|
|
31
|
-
def argAttribute(action: Callable[[ast_Identifier | (ast_Identifier | None)], ast_Identifier | (ast_Identifier | None)]) -> Callable[[hasDOTarg], hasDOTarg]:
|
|
32
|
-
|
|
33
|
-
def workhorse(node: hasDOTarg) -> hasDOTarg:
|
|
34
|
-
node.arg = action(node.arg)
|
|
35
|
-
return node
|
|
36
|
-
return workhorse
|
|
37
|
-
|
|
38
|
-
@staticmethod
|
|
39
|
-
def argsAttribute(action: Callable[[ast.arguments | Sequence[ast.expr] | list[ast.arg]], ast.arguments | Sequence[ast.expr] | list[ast.arg]]) -> Callable[[hasDOTargs], hasDOTargs]:
|
|
40
|
-
|
|
41
|
-
def workhorse(node: hasDOTargs) -> hasDOTargs:
|
|
42
|
-
node.args = action(node.args)
|
|
43
|
-
return node
|
|
44
|
-
return workhorse
|
|
45
|
-
|
|
46
|
-
@staticmethod
|
|
47
|
-
def argtypesAttribute(action: Callable[[Sequence[ast.expr]], Sequence[ast.expr]]) -> Callable[[hasDOTargtypes], hasDOTargtypes]:
|
|
48
|
-
|
|
49
|
-
def workhorse(node: hasDOTargtypes) -> hasDOTargtypes:
|
|
50
|
-
node.argtypes = action(node.argtypes)
|
|
51
|
-
return node
|
|
52
|
-
return workhorse
|
|
53
|
-
|
|
54
|
-
@staticmethod
|
|
55
|
-
def asnameAttribute(action: Callable[[ast_Identifier | None], ast_Identifier | None]) -> Callable[[hasDOTasname], hasDOTasname]:
|
|
56
|
-
|
|
57
|
-
def workhorse(node: hasDOTasname) -> hasDOTasname:
|
|
58
|
-
node.asname = action(node.asname)
|
|
59
|
-
return node
|
|
60
|
-
return workhorse
|
|
61
|
-
|
|
62
|
-
@staticmethod
|
|
63
|
-
def attrAttribute(action: Callable[[ast_Identifier], ast_Identifier]) -> Callable[[hasDOTattr], hasDOTattr]:
|
|
64
|
-
|
|
65
|
-
def workhorse(node: hasDOTattr) -> hasDOTattr:
|
|
66
|
-
node.attr = action(node.attr)
|
|
67
|
-
return node
|
|
68
|
-
return workhorse
|
|
69
|
-
|
|
70
|
-
@staticmethod
|
|
71
|
-
def basesAttribute(action: Callable[[Sequence[ast.expr]], Sequence[ast.expr]]) -> Callable[[hasDOTbases], hasDOTbases]:
|
|
72
|
-
|
|
73
|
-
def workhorse(node: hasDOTbases) -> hasDOTbases:
|
|
74
|
-
node.bases = action(node.bases)
|
|
75
|
-
return node
|
|
76
|
-
return workhorse
|
|
77
|
-
|
|
78
|
-
@staticmethod
|
|
79
|
-
def bodyAttribute(action: Callable[[Sequence[ast.stmt] | ast.expr], Sequence[ast.stmt] | ast.expr]) -> Callable[[hasDOTbody], hasDOTbody]:
|
|
80
|
-
|
|
81
|
-
def workhorse(node: hasDOTbody) -> hasDOTbody:
|
|
82
|
-
node.body = action(node.body)
|
|
83
|
-
return node
|
|
84
|
-
return workhorse
|
|
85
|
-
|
|
86
|
-
@staticmethod
|
|
87
|
-
def boundAttribute(action: Callable[[ast.expr | None], ast.expr | None]) -> Callable[[hasDOTbound], hasDOTbound]:
|
|
88
|
-
|
|
89
|
-
def workhorse(node: hasDOTbound) -> hasDOTbound:
|
|
90
|
-
node.bound = action(node.bound)
|
|
91
|
-
return node
|
|
92
|
-
return workhorse
|
|
93
|
-
|
|
94
|
-
@staticmethod
|
|
95
|
-
def casesAttribute(action: Callable[[list[ast.match_case]], list[ast.match_case]]) -> Callable[[hasDOTcases], hasDOTcases]:
|
|
96
|
-
|
|
97
|
-
def workhorse(node: hasDOTcases) -> hasDOTcases:
|
|
98
|
-
node.cases = action(node.cases)
|
|
99
|
-
return node
|
|
100
|
-
return workhorse
|
|
101
|
-
|
|
102
|
-
@staticmethod
|
|
103
|
-
def causeAttribute(action: Callable[[ast.expr | None], ast.expr | None]) -> Callable[[hasDOTcause], hasDOTcause]:
|
|
104
|
-
|
|
105
|
-
def workhorse(node: hasDOTcause) -> hasDOTcause:
|
|
106
|
-
node.cause = action(node.cause)
|
|
107
|
-
return node
|
|
108
|
-
return workhorse
|
|
109
|
-
|
|
110
|
-
@staticmethod
|
|
111
|
-
def clsAttribute(action: Callable[[ast.expr], ast.expr]) -> Callable[[hasDOTcls], hasDOTcls]:
|
|
112
|
-
|
|
113
|
-
def workhorse(node: hasDOTcls) -> hasDOTcls:
|
|
114
|
-
node.cls = action(node.cls)
|
|
115
|
-
return node
|
|
116
|
-
return workhorse
|
|
117
|
-
|
|
118
|
-
@staticmethod
|
|
119
|
-
def comparatorsAttribute(action: Callable[[Sequence[ast.expr]], Sequence[ast.expr]]) -> Callable[[hasDOTcomparators], hasDOTcomparators]:
|
|
120
|
-
|
|
121
|
-
def workhorse(node: hasDOTcomparators) -> hasDOTcomparators:
|
|
122
|
-
node.comparators = action(node.comparators)
|
|
123
|
-
return node
|
|
124
|
-
return workhorse
|
|
125
|
-
|
|
126
|
-
@staticmethod
|
|
127
|
-
def context_exprAttribute(action: Callable[[ast.expr], ast.expr]) -> Callable[[hasDOTcontext_expr], hasDOTcontext_expr]:
|
|
128
|
-
|
|
129
|
-
def workhorse(node: hasDOTcontext_expr) -> hasDOTcontext_expr:
|
|
130
|
-
node.context_expr = action(node.context_expr)
|
|
131
|
-
return node
|
|
132
|
-
return workhorse
|
|
133
|
-
|
|
134
|
-
@staticmethod
|
|
135
|
-
def conversionAttribute(action: Callable[[int], int]) -> Callable[[hasDOTconversion], hasDOTconversion]:
|
|
136
|
-
|
|
137
|
-
def workhorse(node: hasDOTconversion) -> hasDOTconversion:
|
|
138
|
-
node.conversion = action(node.conversion)
|
|
139
|
-
return node
|
|
140
|
-
return workhorse
|
|
141
|
-
|
|
142
|
-
@staticmethod
|
|
143
|
-
def ctxAttribute(action: Callable[[ast.expr_context], ast.expr_context]) -> Callable[[hasDOTctx], hasDOTctx]:
|
|
144
|
-
|
|
145
|
-
def workhorse(node: hasDOTctx) -> hasDOTctx:
|
|
146
|
-
node.ctx = action(node.ctx)
|
|
147
|
-
return node
|
|
148
|
-
return workhorse
|
|
149
|
-
|
|
150
|
-
@staticmethod
|
|
151
|
-
def decorator_listAttribute(action: Callable[[Sequence[ast.expr]], Sequence[ast.expr]]) -> Callable[[hasDOTdecorator_list], hasDOTdecorator_list]:
|
|
152
|
-
|
|
153
|
-
def workhorse(node: hasDOTdecorator_list) -> hasDOTdecorator_list:
|
|
154
|
-
node.decorator_list = action(node.decorator_list)
|
|
155
|
-
return node
|
|
156
|
-
return workhorse
|
|
157
|
-
|
|
158
|
-
@staticmethod
|
|
159
|
-
def default_valueAttribute(action: Callable[[ast.expr | None], ast.expr | None]) -> Callable[[hasDOTdefault_value], hasDOTdefault_value]:
|
|
160
|
-
|
|
161
|
-
def workhorse(node: hasDOTdefault_value) -> hasDOTdefault_value:
|
|
162
|
-
node.default_value = action(node.default_value)
|
|
163
|
-
return node
|
|
164
|
-
return workhorse
|
|
165
|
-
|
|
166
|
-
@staticmethod
|
|
167
|
-
def defaultsAttribute(action: Callable[[Sequence[ast.expr]], Sequence[ast.expr]]) -> Callable[[hasDOTdefaults], hasDOTdefaults]:
|
|
168
|
-
|
|
169
|
-
def workhorse(node: hasDOTdefaults) -> hasDOTdefaults:
|
|
170
|
-
node.defaults = action(node.defaults)
|
|
171
|
-
return node
|
|
172
|
-
return workhorse
|
|
173
|
-
|
|
174
|
-
@staticmethod
|
|
175
|
-
def eltAttribute(action: Callable[[ast.expr], ast.expr]) -> Callable[[hasDOTelt], hasDOTelt]:
|
|
176
|
-
|
|
177
|
-
def workhorse(node: hasDOTelt) -> hasDOTelt:
|
|
178
|
-
node.elt = action(node.elt)
|
|
179
|
-
return node
|
|
180
|
-
return workhorse
|
|
181
|
-
|
|
182
|
-
@staticmethod
|
|
183
|
-
def eltsAttribute(action: Callable[[Sequence[ast.expr]], Sequence[ast.expr]]) -> Callable[[hasDOTelts], hasDOTelts]:
|
|
184
|
-
|
|
185
|
-
def workhorse(node: hasDOTelts) -> hasDOTelts:
|
|
186
|
-
node.elts = action(node.elts)
|
|
187
|
-
return node
|
|
188
|
-
return workhorse
|
|
189
|
-
|
|
190
|
-
@staticmethod
|
|
191
|
-
def excAttribute(action: Callable[[ast.expr | None], ast.expr | None]) -> Callable[[hasDOTexc], hasDOTexc]:
|
|
192
|
-
|
|
193
|
-
def workhorse(node: hasDOTexc) -> hasDOTexc:
|
|
194
|
-
node.exc = action(node.exc)
|
|
195
|
-
return node
|
|
196
|
-
return workhorse
|
|
197
|
-
|
|
198
|
-
@staticmethod
|
|
199
|
-
def finalbodyAttribute(action: Callable[[Sequence[ast.stmt]], Sequence[ast.stmt]]) -> Callable[[hasDOTfinalbody], hasDOTfinalbody]:
|
|
200
|
-
|
|
201
|
-
def workhorse(node: hasDOTfinalbody) -> hasDOTfinalbody:
|
|
202
|
-
node.finalbody = action(node.finalbody)
|
|
203
|
-
return node
|
|
204
|
-
return workhorse
|
|
205
|
-
|
|
206
|
-
@staticmethod
|
|
207
|
-
def format_specAttribute(action: Callable[[ast.expr | None], ast.expr | None]) -> Callable[[hasDOTformat_spec], hasDOTformat_spec]:
|
|
208
|
-
|
|
209
|
-
def workhorse(node: hasDOTformat_spec) -> hasDOTformat_spec:
|
|
210
|
-
node.format_spec = action(node.format_spec)
|
|
211
|
-
return node
|
|
212
|
-
return workhorse
|
|
213
|
-
|
|
214
|
-
@staticmethod
|
|
215
|
-
def funcAttribute(action: Callable[[ast.expr], ast.expr]) -> Callable[[hasDOTfunc], hasDOTfunc]:
|
|
216
|
-
|
|
217
|
-
def workhorse(node: hasDOTfunc) -> hasDOTfunc:
|
|
218
|
-
node.func = action(node.func)
|
|
219
|
-
return node
|
|
220
|
-
return workhorse
|
|
221
|
-
|
|
222
|
-
@staticmethod
|
|
223
|
-
def generatorsAttribute(action: Callable[[list[ast.comprehension]], list[ast.comprehension]]) -> Callable[[hasDOTgenerators], hasDOTgenerators]:
|
|
224
|
-
|
|
225
|
-
def workhorse(node: hasDOTgenerators) -> hasDOTgenerators:
|
|
226
|
-
node.generators = action(node.generators)
|
|
227
|
-
return node
|
|
228
|
-
return workhorse
|
|
229
|
-
|
|
230
|
-
@staticmethod
|
|
231
|
-
def guardAttribute(action: Callable[[ast.expr | None], ast.expr | None]) -> Callable[[hasDOTguard], hasDOTguard]:
|
|
232
|
-
|
|
233
|
-
def workhorse(node: hasDOTguard) -> hasDOTguard:
|
|
234
|
-
node.guard = action(node.guard)
|
|
235
|
-
return node
|
|
236
|
-
return workhorse
|
|
237
|
-
|
|
238
|
-
@staticmethod
|
|
239
|
-
def handlersAttribute(action: Callable[[list[ast.ExceptHandler]], list[ast.ExceptHandler]]) -> Callable[[hasDOThandlers], hasDOThandlers]:
|
|
240
|
-
|
|
241
|
-
def workhorse(node: hasDOThandlers) -> hasDOThandlers:
|
|
242
|
-
node.handlers = action(node.handlers)
|
|
243
|
-
return node
|
|
244
|
-
return workhorse
|
|
245
|
-
|
|
246
|
-
@staticmethod
|
|
247
|
-
def idAttribute(action: Callable[[ast_Identifier], ast_Identifier]) -> Callable[[hasDOTid], hasDOTid]:
|
|
248
|
-
|
|
249
|
-
def workhorse(node: hasDOTid) -> hasDOTid:
|
|
250
|
-
node.id = action(node.id)
|
|
251
|
-
return node
|
|
252
|
-
return workhorse
|
|
253
|
-
|
|
254
|
-
@staticmethod
|
|
255
|
-
def ifsAttribute(action: Callable[[Sequence[ast.expr]], Sequence[ast.expr]]) -> Callable[[hasDOTifs], hasDOTifs]:
|
|
256
|
-
|
|
257
|
-
def workhorse(node: hasDOTifs) -> hasDOTifs:
|
|
258
|
-
node.ifs = action(node.ifs)
|
|
259
|
-
return node
|
|
260
|
-
return workhorse
|
|
261
|
-
|
|
262
|
-
@staticmethod
|
|
263
|
-
def is_asyncAttribute(action: Callable[[int], int]) -> Callable[[hasDOTis_async], hasDOTis_async]:
|
|
264
|
-
|
|
265
|
-
def workhorse(node: hasDOTis_async) -> hasDOTis_async:
|
|
266
|
-
node.is_async = action(node.is_async)
|
|
267
|
-
return node
|
|
268
|
-
return workhorse
|
|
269
|
-
|
|
270
|
-
@staticmethod
|
|
271
|
-
def itemsAttribute(action: Callable[[list[ast.withitem]], list[ast.withitem]]) -> Callable[[hasDOTitems], hasDOTitems]:
|
|
272
|
-
|
|
273
|
-
def workhorse(node: hasDOTitems) -> hasDOTitems:
|
|
274
|
-
node.items = action(node.items)
|
|
275
|
-
return node
|
|
276
|
-
return workhorse
|
|
277
|
-
|
|
278
|
-
@staticmethod
|
|
279
|
-
def iterAttribute(action: Callable[[ast.expr], ast.expr]) -> Callable[[hasDOTiter], hasDOTiter]:
|
|
280
|
-
|
|
281
|
-
def workhorse(node: hasDOTiter) -> hasDOTiter:
|
|
282
|
-
node.iter = action(node.iter)
|
|
283
|
-
return node
|
|
284
|
-
return workhorse
|
|
285
|
-
|
|
286
|
-
@staticmethod
|
|
287
|
-
def keyAttribute(action: Callable[[ast.expr], ast.expr]) -> Callable[[hasDOTkey], hasDOTkey]:
|
|
288
|
-
|
|
289
|
-
def workhorse(node: hasDOTkey) -> hasDOTkey:
|
|
290
|
-
node.key = action(node.key)
|
|
291
|
-
return node
|
|
292
|
-
return workhorse
|
|
293
|
-
|
|
294
|
-
@staticmethod
|
|
295
|
-
def keysAttribute(action: Callable[[Sequence[ast.expr | None] | Sequence[ast.expr]], Sequence[ast.expr | None] | Sequence[ast.expr]]) -> Callable[[hasDOTkeys], hasDOTkeys]:
|
|
296
|
-
|
|
297
|
-
def workhorse(node: hasDOTkeys) -> hasDOTkeys:
|
|
298
|
-
node.keys = action(node.keys)
|
|
299
|
-
return node
|
|
300
|
-
return workhorse
|
|
301
|
-
|
|
302
|
-
@staticmethod
|
|
303
|
-
def keywordsAttribute(action: Callable[[list[ast.keyword]], list[ast.keyword]]) -> Callable[[hasDOTkeywords], hasDOTkeywords]:
|
|
304
|
-
|
|
305
|
-
def workhorse(node: hasDOTkeywords) -> hasDOTkeywords:
|
|
306
|
-
node.keywords = action(node.keywords)
|
|
307
|
-
return node
|
|
308
|
-
return workhorse
|
|
309
|
-
|
|
310
|
-
@staticmethod
|
|
311
|
-
def kindAttribute(action: Callable[[ast_Identifier | None], ast_Identifier | None]) -> Callable[[hasDOTkind], hasDOTkind]:
|
|
312
|
-
|
|
313
|
-
def workhorse(node: hasDOTkind) -> hasDOTkind:
|
|
314
|
-
node.kind = action(node.kind)
|
|
315
|
-
return node
|
|
316
|
-
return workhorse
|
|
317
|
-
|
|
318
|
-
@staticmethod
|
|
319
|
-
def kw_defaultsAttribute(action: Callable[[Sequence[ast.expr | None]], Sequence[ast.expr | None]]) -> Callable[[hasDOTkw_defaults], hasDOTkw_defaults]:
|
|
320
|
-
|
|
321
|
-
def workhorse(node: hasDOTkw_defaults) -> hasDOTkw_defaults:
|
|
322
|
-
node.kw_defaults = action(node.kw_defaults)
|
|
323
|
-
return node
|
|
324
|
-
return workhorse
|
|
325
|
-
|
|
326
|
-
@staticmethod
|
|
327
|
-
def kwargAttribute(action: Callable[[ast.arg | None], ast.arg | None]) -> Callable[[hasDOTkwarg], hasDOTkwarg]:
|
|
328
|
-
|
|
329
|
-
def workhorse(node: hasDOTkwarg) -> hasDOTkwarg:
|
|
330
|
-
node.kwarg = action(node.kwarg)
|
|
331
|
-
return node
|
|
332
|
-
return workhorse
|
|
333
|
-
|
|
334
|
-
@staticmethod
|
|
335
|
-
def kwd_attrsAttribute(action: Callable[[list[ast_Identifier]], list[ast_Identifier]]) -> Callable[[hasDOTkwd_attrs], hasDOTkwd_attrs]:
|
|
336
|
-
|
|
337
|
-
def workhorse(node: hasDOTkwd_attrs) -> hasDOTkwd_attrs:
|
|
338
|
-
node.kwd_attrs = action(node.kwd_attrs)
|
|
339
|
-
return node
|
|
340
|
-
return workhorse
|
|
341
|
-
|
|
342
|
-
@staticmethod
|
|
343
|
-
def kwd_patternsAttribute(action: Callable[[Sequence[ast.pattern]], Sequence[ast.pattern]]) -> Callable[[hasDOTkwd_patterns], hasDOTkwd_patterns]:
|
|
344
|
-
|
|
345
|
-
def workhorse(node: hasDOTkwd_patterns) -> hasDOTkwd_patterns:
|
|
346
|
-
node.kwd_patterns = action(node.kwd_patterns)
|
|
347
|
-
return node
|
|
348
|
-
return workhorse
|
|
349
|
-
|
|
350
|
-
@staticmethod
|
|
351
|
-
def kwonlyargsAttribute(action: Callable[[list[ast.arg]], list[ast.arg]]) -> Callable[[hasDOTkwonlyargs], hasDOTkwonlyargs]:
|
|
352
|
-
|
|
353
|
-
def workhorse(node: hasDOTkwonlyargs) -> hasDOTkwonlyargs:
|
|
354
|
-
node.kwonlyargs = action(node.kwonlyargs)
|
|
355
|
-
return node
|
|
356
|
-
return workhorse
|
|
357
|
-
|
|
358
|
-
@staticmethod
|
|
359
|
-
def leftAttribute(action: Callable[[ast.expr], ast.expr]) -> Callable[[hasDOTleft], hasDOTleft]:
|
|
360
|
-
|
|
361
|
-
def workhorse(node: hasDOTleft) -> hasDOTleft:
|
|
362
|
-
node.left = action(node.left)
|
|
363
|
-
return node
|
|
364
|
-
return workhorse
|
|
365
|
-
|
|
366
|
-
@staticmethod
|
|
367
|
-
def levelAttribute(action: Callable[[int], int]) -> Callable[[hasDOTlevel], hasDOTlevel]:
|
|
368
|
-
|
|
369
|
-
def workhorse(node: hasDOTlevel) -> hasDOTlevel:
|
|
370
|
-
node.level = action(node.level)
|
|
371
|
-
return node
|
|
372
|
-
return workhorse
|
|
373
|
-
|
|
374
|
-
@staticmethod
|
|
375
|
-
def linenoAttribute(action: Callable[[int], int]) -> Callable[[hasDOTlineno], hasDOTlineno]:
|
|
376
|
-
|
|
377
|
-
def workhorse(node: hasDOTlineno) -> hasDOTlineno:
|
|
378
|
-
node.lineno = action(node.lineno)
|
|
379
|
-
return node
|
|
380
|
-
return workhorse
|
|
381
|
-
|
|
382
|
-
@staticmethod
|
|
383
|
-
def lowerAttribute(action: Callable[[ast.expr | None], ast.expr | None]) -> Callable[[hasDOTlower], hasDOTlower]:
|
|
384
|
-
|
|
385
|
-
def workhorse(node: hasDOTlower) -> hasDOTlower:
|
|
386
|
-
node.lower = action(node.lower)
|
|
387
|
-
return node
|
|
388
|
-
return workhorse
|
|
389
|
-
|
|
390
|
-
@staticmethod
|
|
391
|
-
def moduleAttribute(action: Callable[[ast_Identifier | None], ast_Identifier | None]) -> Callable[[hasDOTmodule], hasDOTmodule]:
|
|
392
|
-
|
|
393
|
-
def workhorse(node: hasDOTmodule) -> hasDOTmodule:
|
|
394
|
-
node.module = action(node.module)
|
|
395
|
-
return node
|
|
396
|
-
return workhorse
|
|
397
|
-
|
|
398
|
-
@staticmethod
|
|
399
|
-
def msgAttribute(action: Callable[[ast.expr | None], ast.expr | None]) -> Callable[[hasDOTmsg], hasDOTmsg]:
|
|
400
|
-
|
|
401
|
-
def workhorse(node: hasDOTmsg) -> hasDOTmsg:
|
|
402
|
-
node.msg = action(node.msg)
|
|
403
|
-
return node
|
|
404
|
-
return workhorse
|
|
405
|
-
|
|
406
|
-
@staticmethod
|
|
407
|
-
def nameAttribute(action: Callable[[ast_Identifier | (ast_Identifier | None) | ast_Identifier | ast.Name], ast_Identifier | (ast_Identifier | None) | ast_Identifier | ast.Name]) -> Callable[[hasDOTname], hasDOTname]:
|
|
408
|
-
|
|
409
|
-
def workhorse(node: hasDOTname) -> hasDOTname:
|
|
410
|
-
node.name = action(node.name)
|
|
411
|
-
return node
|
|
412
|
-
return workhorse
|
|
413
|
-
|
|
414
|
-
@staticmethod
|
|
415
|
-
def namesAttribute(action: Callable[[list[ast.alias] | list[ast_Identifier]], list[ast.alias] | list[ast_Identifier]]) -> Callable[[hasDOTnames], hasDOTnames]:
|
|
416
|
-
|
|
417
|
-
def workhorse(node: hasDOTnames) -> hasDOTnames:
|
|
418
|
-
node.names = action(node.names)
|
|
419
|
-
return node
|
|
420
|
-
return workhorse
|
|
421
|
-
|
|
422
|
-
@staticmethod
|
|
423
|
-
def opAttribute(action: Callable[[ast.operator | ast.boolop | ast.unaryop], ast.operator | ast.boolop | ast.unaryop]) -> Callable[[hasDOTop], hasDOTop]:
|
|
424
|
-
|
|
425
|
-
def workhorse(node: hasDOTop) -> hasDOTop:
|
|
426
|
-
node.op = action(node.op)
|
|
427
|
-
return node
|
|
428
|
-
return workhorse
|
|
429
|
-
|
|
430
|
-
@staticmethod
|
|
431
|
-
def operandAttribute(action: Callable[[ast.expr], ast.expr]) -> Callable[[hasDOToperand], hasDOToperand]:
|
|
432
|
-
|
|
433
|
-
def workhorse(node: hasDOToperand) -> hasDOToperand:
|
|
434
|
-
node.operand = action(node.operand)
|
|
435
|
-
return node
|
|
436
|
-
return workhorse
|
|
437
|
-
|
|
438
|
-
@staticmethod
|
|
439
|
-
def opsAttribute(action: Callable[[Sequence[ast.cmpop]], Sequence[ast.cmpop]]) -> Callable[[hasDOTops], hasDOTops]:
|
|
440
|
-
|
|
441
|
-
def workhorse(node: hasDOTops) -> hasDOTops:
|
|
442
|
-
node.ops = action(node.ops)
|
|
443
|
-
return node
|
|
444
|
-
return workhorse
|
|
445
|
-
|
|
446
|
-
@staticmethod
|
|
447
|
-
def optional_varsAttribute(action: Callable[[ast.expr | None], ast.expr | None]) -> Callable[[hasDOToptional_vars], hasDOToptional_vars]:
|
|
448
|
-
|
|
449
|
-
def workhorse(node: hasDOToptional_vars) -> hasDOToptional_vars:
|
|
450
|
-
node.optional_vars = action(node.optional_vars)
|
|
451
|
-
return node
|
|
452
|
-
return workhorse
|
|
453
|
-
|
|
454
|
-
@staticmethod
|
|
455
|
-
def orelseAttribute(action: Callable[[Sequence[ast.stmt] | ast.expr], Sequence[ast.stmt] | ast.expr]) -> Callable[[hasDOTorelse], hasDOTorelse]:
|
|
456
|
-
|
|
457
|
-
def workhorse(node: hasDOTorelse) -> hasDOTorelse:
|
|
458
|
-
node.orelse = action(node.orelse)
|
|
459
|
-
return node
|
|
460
|
-
return workhorse
|
|
461
|
-
|
|
462
|
-
@staticmethod
|
|
463
|
-
def patternAttribute(action: Callable[[ast.pattern | (ast.pattern | None)], ast.pattern | (ast.pattern | None)]) -> Callable[[hasDOTpattern], hasDOTpattern]:
|
|
464
|
-
|
|
465
|
-
def workhorse(node: hasDOTpattern) -> hasDOTpattern:
|
|
466
|
-
node.pattern = action(node.pattern)
|
|
467
|
-
return node
|
|
468
|
-
return workhorse
|
|
469
|
-
|
|
470
|
-
@staticmethod
|
|
471
|
-
def patternsAttribute(action: Callable[[Sequence[ast.pattern]], Sequence[ast.pattern]]) -> Callable[[hasDOTpatterns], hasDOTpatterns]:
|
|
472
|
-
|
|
473
|
-
def workhorse(node: hasDOTpatterns) -> hasDOTpatterns:
|
|
474
|
-
node.patterns = action(node.patterns)
|
|
475
|
-
return node
|
|
476
|
-
return workhorse
|
|
477
|
-
|
|
478
|
-
@staticmethod
|
|
479
|
-
def posonlyargsAttribute(action: Callable[[list[ast.arg]], list[ast.arg]]) -> Callable[[hasDOTposonlyargs], hasDOTposonlyargs]:
|
|
480
|
-
|
|
481
|
-
def workhorse(node: hasDOTposonlyargs) -> hasDOTposonlyargs:
|
|
482
|
-
node.posonlyargs = action(node.posonlyargs)
|
|
483
|
-
return node
|
|
484
|
-
return workhorse
|
|
485
|
-
|
|
486
|
-
@staticmethod
|
|
487
|
-
def restAttribute(action: Callable[[ast_Identifier | None], ast_Identifier | None]) -> Callable[[hasDOTrest], hasDOTrest]:
|
|
488
|
-
|
|
489
|
-
def workhorse(node: hasDOTrest) -> hasDOTrest:
|
|
490
|
-
node.rest = action(node.rest)
|
|
491
|
-
return node
|
|
492
|
-
return workhorse
|
|
493
|
-
|
|
494
|
-
@staticmethod
|
|
495
|
-
def returnsAttribute(action: Callable[[ast.expr | (ast.expr | None)], ast.expr | (ast.expr | None)]) -> Callable[[hasDOTreturns], hasDOTreturns]:
|
|
496
|
-
|
|
497
|
-
def workhorse(node: hasDOTreturns) -> hasDOTreturns:
|
|
498
|
-
node.returns = action(node.returns)
|
|
499
|
-
return node
|
|
500
|
-
return workhorse
|
|
501
|
-
|
|
502
|
-
@staticmethod
|
|
503
|
-
def rightAttribute(action: Callable[[ast.expr], ast.expr]) -> Callable[[hasDOTright], hasDOTright]:
|
|
504
|
-
|
|
505
|
-
def workhorse(node: hasDOTright) -> hasDOTright:
|
|
506
|
-
node.right = action(node.right)
|
|
507
|
-
return node
|
|
508
|
-
return workhorse
|
|
509
|
-
|
|
510
|
-
@staticmethod
|
|
511
|
-
def simpleAttribute(action: Callable[[int], int]) -> Callable[[hasDOTsimple], hasDOTsimple]:
|
|
512
|
-
|
|
513
|
-
def workhorse(node: hasDOTsimple) -> hasDOTsimple:
|
|
514
|
-
node.simple = action(node.simple)
|
|
515
|
-
return node
|
|
516
|
-
return workhorse
|
|
517
|
-
|
|
518
|
-
@staticmethod
|
|
519
|
-
def sliceAttribute(action: Callable[[ast_expr_Slice], ast_expr_Slice]) -> Callable[[hasDOTslice], hasDOTslice]:
|
|
520
|
-
|
|
521
|
-
def workhorse(node: hasDOTslice) -> hasDOTslice:
|
|
522
|
-
node.slice = action(node.slice)
|
|
523
|
-
return node
|
|
524
|
-
return workhorse
|
|
525
|
-
|
|
526
|
-
@staticmethod
|
|
527
|
-
def stepAttribute(action: Callable[[ast.expr | None], ast.expr | None]) -> Callable[[hasDOTstep], hasDOTstep]:
|
|
528
|
-
|
|
529
|
-
def workhorse(node: hasDOTstep) -> hasDOTstep:
|
|
530
|
-
node.step = action(node.step)
|
|
531
|
-
return node
|
|
532
|
-
return workhorse
|
|
533
|
-
|
|
534
|
-
@staticmethod
|
|
535
|
-
def subjectAttribute(action: Callable[[ast.expr], ast.expr]) -> Callable[[hasDOTsubject], hasDOTsubject]:
|
|
536
|
-
|
|
537
|
-
def workhorse(node: hasDOTsubject) -> hasDOTsubject:
|
|
538
|
-
node.subject = action(node.subject)
|
|
539
|
-
return node
|
|
540
|
-
return workhorse
|
|
541
|
-
|
|
542
|
-
@staticmethod
|
|
543
|
-
def tagAttribute(action: Callable[[ast_Identifier], ast_Identifier]) -> Callable[[hasDOTtag], hasDOTtag]:
|
|
544
|
-
|
|
545
|
-
def workhorse(node: hasDOTtag) -> hasDOTtag:
|
|
546
|
-
node.tag = action(node.tag)
|
|
547
|
-
return node
|
|
548
|
-
return workhorse
|
|
549
|
-
|
|
550
|
-
@staticmethod
|
|
551
|
-
def targetAttribute(action: Callable[[ast.Name | ast.Attribute | ast.Subscript | ast.expr | ast.Name], ast.Name | ast.Attribute | ast.Subscript | ast.expr | ast.Name]) -> Callable[[hasDOTtarget], hasDOTtarget]:
|
|
552
|
-
|
|
553
|
-
def workhorse(node: hasDOTtarget) -> hasDOTtarget:
|
|
554
|
-
node.target = action(node.target)
|
|
555
|
-
return node
|
|
556
|
-
return workhorse
|
|
557
|
-
|
|
558
|
-
@staticmethod
|
|
559
|
-
def targetsAttribute(action: Callable[[Sequence[ast.expr]], Sequence[ast.expr]]) -> Callable[[hasDOTtargets], hasDOTtargets]:
|
|
560
|
-
|
|
561
|
-
def workhorse(node: hasDOTtargets) -> hasDOTtargets:
|
|
562
|
-
node.targets = action(node.targets)
|
|
563
|
-
return node
|
|
564
|
-
return workhorse
|
|
565
|
-
|
|
566
|
-
@staticmethod
|
|
567
|
-
def testAttribute(action: Callable[[ast.expr], ast.expr]) -> Callable[[hasDOTtest], hasDOTtest]:
|
|
568
|
-
|
|
569
|
-
def workhorse(node: hasDOTtest) -> hasDOTtest:
|
|
570
|
-
node.test = action(node.test)
|
|
571
|
-
return node
|
|
572
|
-
return workhorse
|
|
573
|
-
|
|
574
|
-
@staticmethod
|
|
575
|
-
def typeAttribute(action: Callable[[ast.expr | None], ast.expr | None]) -> Callable[[hasDOTtype], hasDOTtype]:
|
|
576
|
-
|
|
577
|
-
def workhorse(node: hasDOTtype) -> hasDOTtype:
|
|
578
|
-
node.type = action(node.type)
|
|
579
|
-
return node
|
|
580
|
-
return workhorse
|
|
581
|
-
|
|
582
|
-
@staticmethod
|
|
583
|
-
def type_commentAttribute(action: Callable[[ast_Identifier | None], ast_Identifier | None]) -> Callable[[hasDOTtype_comment], hasDOTtype_comment]:
|
|
584
|
-
|
|
585
|
-
def workhorse(node: hasDOTtype_comment) -> hasDOTtype_comment:
|
|
586
|
-
node.type_comment = action(node.type_comment)
|
|
587
|
-
return node
|
|
588
|
-
return workhorse
|
|
589
|
-
|
|
590
|
-
@staticmethod
|
|
591
|
-
def type_ignoresAttribute(action: Callable[[list[ast.TypeIgnore]], list[ast.TypeIgnore]]) -> Callable[[hasDOTtype_ignores], hasDOTtype_ignores]:
|
|
592
|
-
|
|
593
|
-
def workhorse(node: hasDOTtype_ignores) -> hasDOTtype_ignores:
|
|
594
|
-
node.type_ignores = action(node.type_ignores)
|
|
595
|
-
return node
|
|
596
|
-
return workhorse
|
|
597
|
-
|
|
598
|
-
@staticmethod
|
|
599
|
-
def type_paramsAttribute(action: Callable[[Sequence[astDOTtype_param]], Sequence[astDOTtype_param]]) -> Callable[[hasDOTtype_params], hasDOTtype_params]:
|
|
600
|
-
|
|
601
|
-
def workhorse(node: hasDOTtype_params) -> hasDOTtype_params:
|
|
602
|
-
node.type_params = action(node.type_params)
|
|
603
|
-
return node
|
|
604
|
-
return workhorse
|
|
605
|
-
|
|
606
|
-
@staticmethod
|
|
607
|
-
def upperAttribute(action: Callable[[ast.expr | None], ast.expr | None]) -> Callable[[hasDOTupper], hasDOTupper]:
|
|
608
|
-
|
|
609
|
-
def workhorse(node: hasDOTupper) -> hasDOTupper:
|
|
610
|
-
node.upper = action(node.upper)
|
|
611
|
-
return node
|
|
612
|
-
return workhorse
|
|
613
|
-
|
|
614
|
-
@staticmethod
|
|
615
|
-
def valueAttribute(action: Callable[[ast.expr | None | ast.expr | Any | (Literal[True, False] | None)], ast.expr | None | ast.expr | Any | (Literal[True, False] | None)]) -> Callable[[hasDOTvalue], hasDOTvalue]:
|
|
616
|
-
|
|
617
|
-
def workhorse(node: hasDOTvalue) -> hasDOTvalue:
|
|
618
|
-
node.value = action(node.value)
|
|
619
|
-
return node
|
|
620
|
-
return workhorse
|
|
621
|
-
|
|
622
|
-
@staticmethod
|
|
623
|
-
def valuesAttribute(action: Callable[[Sequence[ast.expr]], Sequence[ast.expr]]) -> Callable[[hasDOTvalues], hasDOTvalues]:
|
|
624
|
-
|
|
625
|
-
def workhorse(node: hasDOTvalues) -> hasDOTvalues:
|
|
626
|
-
node.values = action(node.values)
|
|
627
|
-
return node
|
|
628
|
-
return workhorse
|
|
629
|
-
|
|
630
|
-
@staticmethod
|
|
631
|
-
def varargAttribute(action: Callable[[ast.arg | None], ast.arg | None]) -> Callable[[hasDOTvararg], hasDOTvararg]:
|
|
632
|
-
|
|
633
|
-
def workhorse(node: hasDOTvararg) -> hasDOTvararg:
|
|
634
|
-
node.vararg = action(node.vararg)
|
|
635
|
-
return node
|
|
636
|
-
return workhorse
|
|
637
|
-
|
|
638
|
-
@staticmethod
|
|
639
|
-
def andDoAllOf(listOfActions: list[Callable[[NodeORattribute], NodeORattribute]]) -> Callable[[NodeORattribute], NodeORattribute]:
|
|
640
|
-
|
|
641
|
-
def workhorse(node: NodeORattribute) -> NodeORattribute:
|
|
642
|
-
for action in listOfActions:
|
|
643
|
-
node = action(node)
|
|
644
|
-
return node
|
|
645
|
-
return workhorse
|
|
646
|
-
|
|
647
|
-
@staticmethod
|
|
648
|
-
def funcDOTidAttribute(action: Callable[[ast_Identifier], Any]) -> Callable[[ImaCallToName], ImaCallToName]:
|
|
649
|
-
|
|
650
|
-
def workhorse(node: ImaCallToName) -> ImaCallToName:
|
|
651
|
-
node.func = Grab.idAttribute(action)(node.func)
|
|
652
|
-
return node
|
|
653
|
-
return workhorse
|