Skip to content

Commit b0940e6

Browse files
authored
Merge pull request #9 from hunterhogan/copilot/vscode1756473539902
Copilot/vscode1756473539902
2 parents f69358c + f5706f5 commit b0940e6

8 files changed

Lines changed: 79 additions & 234 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.

CITATION.cff

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ authors:
77
family-names: Hogan
88
email: HunterHogan@pm.me
99
cff-version: 1.2.0
10-
commit: 2eb89377c9ade75ebebc1a8057b8cf14b2504861
11-
date-released: '2025-07-21'
10+
commit: f69358c099d2cbf0debd2a2e64f87f3c564af484
11+
date-released: '2025-09-07'
1212
identifiers:
1313
- type: url
14-
value: https://github.com/hunterhogan/astToolkit/releases/tag/0.7.1
15-
description: The URL for astToolkit 0.7.1.
14+
value: https://github.com/hunterhogan/astToolkit/releases/tag/0.7.2
15+
description: The URL for astToolkit 0.7.2.
1616
keywords:
1717
- abstract syntax tree
1818
- ast
@@ -37,9 +37,9 @@ keywords:
3737
license: CC-BY-NC-4.0
3838
message: Cite this software with the metadata in this file.
3939
repository: https://github.com/hunterhogan/astToolkit.git
40-
repository-artifact: https://pypi.org/project/asttoolkit/0.7.1/
41-
repository-code: https://github.com/hunterhogan/astToolkit/releases/tag/0.7.1
40+
repository-artifact: https://pypi.org/project/asttoolkit/0.7.2/
41+
repository-code: https://github.com/hunterhogan/astToolkit/releases/tag/0.7.2
4242
title: astToolkit
4343
type: software
4444
url: https://github.com/hunterhogan/astToolkit
45-
version: 0.7.1
45+
version: 0.7.2

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)