-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--docstrings
option for returning signatures with docstrings
#25
Comments
Some ChatGPT research: https://chat.openai.com/share/f9b4f1d0-cedb-4576-a145-ad3eac345d27 Which helped me by writing this: def convert_to_quoted(s):
# Check if the string spans multiple lines
if "\n" in s:
# Escape triple double quotes
s = s.replace('"""', '\\"\\"\\"')
# Now wrap the whole string into triple double quotes
return f'"""{s}"""'
else:
# Escape double quotes
s = s.replace('"', '\\"')
# Now wrap the whole string into double quotes
return f'"{s}"' |
Slight point of confusion: It might be expected to act as a filter, showing only functions with docstrings - for consistency with Now that I'm trying it out I find myself wanting a way to see "all functions with docstrings" and "all functions without docstrings". I could do |
git diff | llm --system 'describe this change' -m 3.5-16k
|
Example: symbex --docstrings --documented -f symbex/lib.py # File: symbex/lib.py Line: 12
def find_symbol_nodes(code: str, filename: str, symbols: Iterable[str]) -> List[Tuple[(AST, Optional[str])]]
"Returns ast Nodes matching symbols"
# File: symbex/lib.py Line: 36
def code_for_node(code: str, node: AST, class_name: str, signatures: bool, docstrings: bool) -> Tuple[(str, int)]
"Returns the code for a given node"
# File: symbex/lib.py Line: 80
def match(name: str, symbols: Iterable[str]) -> bool
"Returns True if name matches any of the symbols, resolving wildcards" |
Can use
ast.get_docstring(node)
for this.I'd like to show these as double quoted or triple-double-quoted strings.
The text was updated successfully, but these errors were encountered: