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
While all of the pytest tests pass, the example from the readme:
from ast_tools.passes import begin_rewrite, loop_unroll, end_rewrite
@end_rewrite()
@loop_unroll()
@begin_rewrite()
def foo():
for i in ast_tools.macros.unroll(range(8)):
print(i)
Fails with the error:
Traceback (most recent call last):
File "tests/test_readme.py", line 5, in <module>
@begin_rewrite()
File "/ast_tools/ast_tools/passes/base.py", line 23, in __call__
return self.rewrite(*args)
File "/ast_tools/ast_tools/passes/loop_unroll.py", line 15, in rewrite
return unroll_for_loops(tree, env), env, metadata
File "/ast_tools/ast_tools/transformers/loop_unroller.py", line 49, in unroll_for_loops
new_body = tree.body.visit(visitor)
AttributeError: 'list' object has no attribute 'visit'
I actually can't get any code that uses either the @begin_rewrite() and @end_rewrite() or the @apply_ast_passes to work.
This is on Python3.7 in a completely new virtualenv.
The text was updated successfully, but these errors were encountered:
While all of the pytest tests pass, the example from the readme:
Fails with the error:
I actually can't get any code that uses either the @begin_rewrite() and @end_rewrite() or the @apply_ast_passes to work.
This is on Python3.7 in a completely new virtualenv.
The text was updated successfully, but these errors were encountered: