Wrong code to recompute annotations
Created originally on Bitbucket by paugier (Pierre Augier)
from functools import partial
from transonic import boost
@boost
def compute(a: int):
return a
# if True:
main = partial(lambda x: x, lambda x: x)
leads to
transonic -np tmp_bug_transonic.py -vv
INFO Namespace(clear_cache=None, force=False, no_pythran=True, path=['tmp_bug_transonic.py'], pythran_flags='', verbose=2, version=False)
DEBUG extast.parse
DEBUG compute ancestors and chains
DEBUG filter_code_typevars
DEBUG
from transonic import boost
main = partial((lambda x: x), (lambda x: x))
DEBUG find boosted objects
DEBUG {'classes': {},
'functions': {'compute': <gast.gast.FunctionDef object at 0x7f3de0afca90>},
'methods': {}}
DEBUG compute the annotations
Traceback (most recent call last):
File "/home/pierre/.pyenv/versions/3.7.2/bin/transonic", line 11, in <module>
load_entry_point('transonic', 'console_scripts', 'transonic')()
File "/home/pierre/Dev/transonic/transonic/run.py", line 84, in run
make_backend_files(paths, force=args.force)
File "/home/pierre/Dev/transonic/transonic/transpiler.py", line 284, in make_backend_files
path_out = make_pythran_file(path, force=force)
File "/home/pierre/Dev/transonic/transonic/transpiler.py", line 236, in make_pythran_file
code_pythran = make_pythran_code(path_py)
File "/home/pierre/Dev/transonic/transonic/backends/pythran.py", line 204, in make_pythran_code
boosted_dicts, code_dependance, annotations, blocks = analyse_aot(code_module)
File "/home/pierre/Dev/transonic/transonic/analyses/__init__.py", line 126, in analyse_aot
exec(code_dependance_annotations, namespace)
File "<string>", line 3, in <module>
NameError: name 'partial' is not defined