Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in analyzers.py #18

Closed
Andres981231 opened this issue Jan 24, 2022 · 5 comments
Closed

Error in analyzers.py #18

Andres981231 opened this issue Jan 24, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Andres981231
Copy link

Andres981231 commented Jan 24, 2022

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!

@Andres981231
Copy link
Author

Should add "from typed_ast import _ast3" in type_infer_tutorial.py.

@Jarvx
Copy link
Collaborator

Jarvx commented Jan 25, 2022

Hi,

Thanks for pointing this out. Could you please let us know your environment information as we cannot reproduce this error?

@Jarvx Jarvx self-assigned this Jan 25, 2022
@Jarvx Jarvx added the bug Something isn't working label Jan 25, 2022
@Jarvx Jarvx reopened this Jan 25, 2022
@Andres981231
Copy link
Author

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.

@Andres981231
Copy link
Author

Andres981231 commented Jan 25, 2022

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".

@Jarvx
Copy link
Collaborator

Jarvx commented Jan 25, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants