Closed Andres981231 closed 2 years ago
Should add "from typed_ast import _ast3" in type_infer_tutorial.py.
Hi,
Thanks for pointing this out. Could you please let us know your environment information as we cannot reproduce this error?
I manually install Scalpel with setup.py instead of pip, and tested on both windows10 and ubuntu18.04, with python version 3.7.0, both produced this error.
I also wonder whether the type inference functionbility will consider the import module of a python program. Since in my local test, for code piece "A = (a class from imported module)", the variable A's type was inferred as "Any".
Thanks for the information to reproduce the error. Regarding the given test case, at this stage, we do not consider it as a type because the imported names such as "from A import B" might not be a class. "B" can be a module name instead. We are still working on better algorithms for type inference. Thanks a lot for raising this issue.
When I try to run type_infer_tutorial.py in the examples, I got the error "AttributeError: module 'typed_ast' has no attribute '_ast3'" which is caused by typeinfer/analysers.py at line 150. I wonder whether this is a bug in the development? Thanks!