You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import ast
dialect_str = 'a, /, b, c=3, *, d, e=5'
input_str = f'def f({dialect_str}): pass'
tree = ast.parse(input_str)
# Disect the tree here to get to the juicy function object whose Signature we want
Specifically, the idea is to format the dialect in the same format python functions define their arguments.
The easy and slightly terrifying solution would be eval(def f({dialect_str}): pass), with the user provided dialect_str (and then getting the function, and pulling out its signature). But then you're executing user provided code, which is always a bad idea.
See PR #25
The text was updated successfully, but these errors were encountered: