Skip to content

Commit df2db28

Browse files
committed
Checkpoint from VS Code for coding agent session
1 parent f69358c commit df2db28

5 files changed

Lines changed: 66 additions & 219 deletions

File tree

CC-BY-NC-4.0.png

10.4 KB
Loading

CC-BY-NC-4.0.svg

Lines changed: 0 additions & 190 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,4 @@ Coding One Step at a Time:
312312
2. Write good code.
313313
3. When revising, write better code.
314314

315-
[![CC-BY-NC-4.0](https://github.com/hunterhogan/astToolkit/blob/main/CC-BY-NC-4.0.svg)](https://creativecommons.org/licenses/by-nc/4.0/)
315+
[![CC-BY-NC-4.0](https://github.com/hunterhogan/astToolkit/blob/main/CC-BY-NC-4.0.png)](https://creativecommons.org/licenses/by-nc/4.0/)

astToolkit/_toolkitAST.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,19 @@ def extractClassDef(astAST: ast.AST, identifier: str) -> ast.ClassDef | None:
7171

7272
def extractFunctionDef(astAST: ast.AST, identifier: str) -> ast.FunctionDef | None:
7373
"""
74-
Extract a function definition with a specific name from an AST module.
75-
76-
(AI generated docstring)
77-
78-
This function searches through an AST module for a function definition that matches the provided identifier and returns it if found.
74+
Extract the function from `astAST` with `ast.FunctionDef.name == identifier`.
7975
8076
Parameters
8177
----------
8278
astAST : ast.AST
83-
The AST object to search within.
79+
(abstract syntax tree) An `ast.AST` subclass from which to extract the function.
8480
identifier : str
85-
The name of the function to find.
81+
The identifier in `ast.FunctionDef.name`.
8682
8783
Returns
8884
-------
89-
astFunctionDef | None
90-
The matching function definition AST node, or `None` if not found.
85+
astFunctionDef : ast.FunctionDef | None
86+
The target function, or `None` if `extractFunctionDef` does not find `ast.FunctionDef.name == identifier`.
9187
9288
"""
9389
return NodeTourist(IfThis.isFunctionDefIdentifier(identifier), Then.extractIt).captureLastMatch(astAST)
@@ -99,7 +95,7 @@ def parseLogicalPath2astModule(logicalPath: identifierDotAttribute, package: str
9995
(AI generated docstring)
10096
10197
This function imports a module using its logical path (e.g., 'scipy.signal.windows') and converts its source code into an
102-
`ast.Module` (abstract syntax tree) object. Supports all relevant `ast.parse` parameters.
98+
`ast.Module` (abstract syntax tree) `object`. Supports all relevant `ast.parse` parameters.
10399
104100
Parameters
105101
----------

0 commit comments

Comments
 (0)