Commits

Stephen Tu committed 1e2872e

varargs and kwarg in func def treated as assignment to list/dict respectively

Comments (0)

Files changed (1)

pypy/interpreter/astcompiler/codegen.py

                     param = args_r[idx]
                     default = dfts_r[idx]
                     self._assignment_like(param, default, False)
+        if args.vararg:
+            # treat as assignment to list
+            self._record_binary_feature_by_name(
+                args.vararg, 'assigned_%s' % (self._TypeToFeatureName[self._LIST_TYPE]))
+        if args.kwarg:
+            # treat as assignment to dict
+            self._record_binary_feature_by_name(
+                args.kwarg, 'assigned_%s' % (self._TypeToFeatureName[self._DICT_TYPE]))
         self.visit_sequence(args.args)
         self.visit_sequence(func.body)
         self._pop_scope()