Closed khatchad closed 2 years ago
Hi, Thank you for raising this issues. The tool is interprocedural in terms of implementation. However, it looks to me the results from the tool is :
{'file': 'case18.py', 'line_number': 5, 'function': 'MyParentClass.my_function', 'type': {'str'}}
{'file': 'case18.py', 'line_number': 11, 'function': 'ChildClass.my_function', 'type': {'List[str]'}}
Can you please provide your execution environment information?
Best regards, Jiawei
Sure:
$ uname -a
Linux rk1424-ThinkPad-L14-Gen-1 5.15.0-27-generic #28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ python --version
Python 3.10.4
I'm on be392671a5f55f5da8b2ca0a079207c55261ab03.
This is due to the dependency issue when accessing typshed project. Will fix it soon.
I got the following error Running [type_infer_tutorial.py]: Traceback (most recent call last): File "C:\Users\00\Desktop\Hityper\Scalpel-master\Scalpel-master\ex.py", line 1, in from scalpel.typeinfer.typeinfer import TypeInference File "C:\Users\00\Desktop\Hityper\Scalpel-master\Scalpel-master\scalpel\typeinfer\typeinfer.py", line 14, in from scalpel.typeinfer.analysers import ( File "C:\Users\00\Desktop\Hityper\Scalpel-master\Scalpel-master\scalpel\typeinfer\analysers.py", line 9, in from typed_ast import ast3 ModuleNotFoundError: No module named 'typed_ast'
what should I do to get the type inference for a file?? Thanks for reporting this. It seems due to the Python version. Did you execute the command under Python3.10?
Python 3.9.7
Python 3.9.7
Okay, I will test this very soon.
thanks for replay should I install python 3.8
from typed_ast import ast3
You can try ' from typed_ast import ast3' and see if that works for your environment
how did you get type inference and you used python 3.10? @khatchad
I tested it under 3.9 and it works. We will conduct future testing on this. Thanks for pointing this out
Please feel free to reopen if you have any questions.
Consider the following modified
type_infer_example.py
(`:Running
type_infer_tutorial.py
on this file, I get the following output (slightly modified for clarify):Given that
my_function
has typestr
, should noty
have typestr
as well instead ofany
? I am confused about two things:type_infer_example.py
and that multiple functions are defined in that file?