Author: Ronan Lamy <ronan.l...@gmail.com> Branch: less-stringly-ops Changeset: r68231:5f4e3a547a2c Date: 2013-11-18 22:07 +0000 http://bitbucket.org/pypy/pypy/changeset/5f4e3a547a2c/
Log: make ArgumentsForTranslation a subclass of CallSpec diff --git a/rpython/annotator/argument.py b/rpython/annotator/argument.py --- a/rpython/annotator/argument.py +++ b/rpython/annotator/argument.py @@ -2,22 +2,9 @@ Arguments objects. """ from rpython.annotator.model import SomeTuple +from rpython.flowspace.argument import CallSpec -class ArgumentsForTranslation(object): - def __init__(self, args_w, keywords=None, w_stararg=None): - self.w_stararg = w_stararg - assert isinstance(args_w, list) - self.arguments_w = args_w - self.keywords = keywords or {} - - def __repr__(self): - """ NOT_RPYTHON """ - name = self.__class__.__name__ - if not self.keywords: - return '%s(%s)' % (name, self.arguments_w,) - else: - return '%s(%s, %s)' % (name, self.arguments_w, self.keywords) - +class ArgumentsForTranslation(CallSpec): @property def positional_args(self): if self.w_stararg is not None: diff --git a/rpython/flowspace/argument.py b/rpython/flowspace/argument.py --- a/rpython/flowspace/argument.py +++ b/rpython/flowspace/argument.py @@ -83,6 +83,14 @@ self.arguments_w = args_w self.keywords = keywords or {} + def __repr__(self): + """ NOT_RPYTHON """ + name = self.__class__.__name__ + if not self.keywords: + return '%s(%s)' % (name, self.arguments_w,) + else: + return '%s(%s, %s)' % (name, self.arguments_w, self.keywords) + def flatten(self): """ Argument <-> list of w_objects together with "shape" information """ shape_cnt = len(self.arguments_w) # Number of positional args _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit