Skip to content

Commit 10ef365

Browse files
committed
mark a TODO documenting a new approach for transform_statements
1 parent f4d8e7c commit 10ef365

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

unpythonic/syntax/util.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,11 @@ def transform_statements(f, body):
433433
"""
434434
def rec(tree):
435435
# TODO: brittle, may need changes as the Python AST evolves. Better ways to do this?
436+
#
437+
# TODO: In the __mro__ of AST nodes, there's ast.expr for expressions
438+
# TODO: and ast.stmt for statements. Could we isinstance() on that,
439+
# TODO: dir() the attributes, and recurse on anything that contains
440+
# TODO: further statements?
436441
if type(tree) in (FunctionDef, AsyncFunctionDef, ClassDef, With, AsyncWith):
437442
tree.body = rec(tree.body)
438443
elif type(tree) in (If, For, While, AsyncFor):

0 commit comments

Comments
 (0)