Given an element from the ast which is an assignment statement, return a Variable that points_to the type of object being assigned. For now, the points_to is a string but that is resolved later. :param element ast: :rtype: Variable
(element)
| 58 | |
| 59 | |
| 60 | def process_assign(element): |
| 61 | """ |
| 62 | Given an element from the ast which is an assignment statement, return a |
| 63 | Variable that points_to the type of object being assigned. For now, the |
| 64 | points_to is a string but that is resolved later. |
| 65 | |
| 66 | :param element ast: |
| 67 | :rtype: Variable |
| 68 | """ |
| 69 | |
| 70 | if type(element.value) != ast.Call: |
| 71 | return [] |
| 72 | call = get_call_from_func_element(element.value.func) |
| 73 | if not call: |
| 74 | return [] |
| 75 | |
| 76 | ret = [] |
| 77 | for target in element.targets: |
| 78 | if type(target) != ast.Name: |
| 79 | continue |
| 80 | token = target.id |
| 81 | ret.append(Variable(token, call, element.lineno)) |
| 82 | return ret |
| 83 | |
| 84 | |
| 85 | def process_import(element): |
no test coverage detected