MCPcopy Index your code
hub / github.com/datacamp/pythonwhat / get_target_vars

Method get_target_vars

pythonwhat/parsing.py:133–142  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

131
132 @staticmethod
133 def get_target_vars(target):
134 get_id = lambda n: n.id if not isinstance(n, ast.Starred) else n.value.id
135 if isinstance(target, (ast.Name, ast.Starred)):
136 tv = [get_id(target)]
137 elif isinstance(target, ast.Tuple):
138 tv = [get_id(node) for node in target.elts]
139 else:
140 tv = []
141
142 return TargetVars(tv)
143
144 @staticmethod
145 def get_arg(el):

Callers 4

visit_ForMethod · 0.80
build_compMethod · 0.80
visit_DictCompMethod · 0.80
visit_WithMethod · 0.80

Calls 1

TargetVarsClass · 0.85

Tested by

no test coverage detected