1.1 --- a/simplify/annotate.py Sun Aug 05 21:38:40 2007 +0200
1.2 +++ b/simplify/annotate.py Mon Aug 06 00:53:52 2007 +0200
1.3 @@ -1135,18 +1135,21 @@
1.4 params = subprogram.params
1.5 items = []
1.6 star_args = []
1.7 + consumed_args = []
1.8
1.9 # Match each positional argument, taking excess arguments as star args.
1.10
1.11 for arg in pos_args:
1.12 if params:
1.13 param, default = params[0]
1.14 - if arg is None:
1.15 - arg = default
1.16 if hasattr(arg, "types"):
1.17 items.append((param, arg.types))
1.18 else:
1.19 items.append((param, set())) # Annotation has not succeeded.
1.20 +
1.21 + # Record consumption order.
1.22 +
1.23 + consumed_args.append(arg)
1.24 params = params[1:]
1.25 else:
1.26 star_args.append(arg)
1.27 @@ -1167,6 +1170,10 @@
1.28 items.append((param, arg.types))
1.29 else:
1.30 items.append((param, set())) # Annotation has not succeeded.
1.31 +
1.32 + # Record consumption order (this is not the Keyword node, however).
1.33 +
1.34 + consumed_args.append(arg)
1.35 params = params[1:]
1.36
1.37 dstar_args = kw_args.items()
1.38 @@ -1221,6 +1228,7 @@
1.39 # Record the parameter types.
1.40
1.41 self.annotate_parameters(subprogram, items)
1.42 + invocation.consumed_args[subprogram] = consumed_args
1.43 return subprogram.paramtypes.items()
1.44
1.45 def make_star_args(self, invocation, subprogram, star_args):