Author: Ronan Lamy <[email protected]>
Branch: less-stringly-ops
Changeset: r67651:993ad988ef75
Date: 2013-10-20 01:37 +0100
http://bitbucket.org/pypy/pypy/changeset/993ad988ef75/
Log: rm dead code in RpythonCallsSpace
diff --git a/rpython/annotator/argument.py b/rpython/annotator/argument.py
--- a/rpython/annotator/argument.py
+++ b/rpython/annotator/argument.py
@@ -1,7 +1,7 @@
"""
Arguments objects.
"""
-from rpython.annotator.model import SomeTuple, SomeObject
+from rpython.annotator.model import SomeTuple
# for parsing call arguments
class RPythonCallsSpace(object):
@@ -10,28 +10,11 @@
that the call pattern is too complex for R-Python.
"""
def newtuple(self, items_s):
- if len(items_s) == 1 and items_s[0] is Ellipsis:
- res = SomeObject() # hack to get a SomeObject as the *arg
- res.from_ellipsis = True
- return res
- else:
- return SomeTuple(items_s)
+ return SomeTuple(items_s)
- def unpackiterable(self, s_obj, expected_length=None):
- if isinstance(s_obj, SomeTuple):
- return list(s_obj.items)
- if (s_obj.__class__ is SomeObject and
- getattr(s_obj, 'from_ellipsis', False)): # see newtuple()
- return [Ellipsis]
- raise CallPatternTooComplex("'*' argument must be SomeTuple")
-
- def bool(self, s_tup):
- assert isinstance(s_tup, SomeTuple)
- return bool(s_tup.items)
-
-
-class CallPatternTooComplex(Exception):
- pass
+ def unpackiterable(self, s_obj):
+ assert isinstance(s_obj, SomeTuple)
+ return list(s_obj.items)
class ArgumentsForTranslation(object):
diff --git a/rpython/rtyper/callparse.py b/rpython/rtyper/callparse.py
--- a/rpython/rtyper/callparse.py
+++ b/rpython/rtyper/callparse.py
@@ -4,9 +4,6 @@
from rpython.rtyper.error import TyperError
from rpython.rtyper.lltypesystem import lltype
-class CallPatternTooComplex(TyperError):
- pass
-
def getrinputs(rtyper, graph):
"""Return the list of reprs of the input arguments to the 'graph'."""
@@ -163,27 +160,10 @@
For the Arguments class: if it really needs other operations, it means
that the call pattern is too complex for R-Python.
"""
- w_tuple = NewTupleHolder
def newtuple(self, items):
return NewTupleHolder(items)
- def newdict(self):
- raise CallPatternTooComplex, "'**' argument"
-
- def unpackiterable(self, it, expected_length=None):
- if it.is_tuple():
- items = it.items()
- if (expected_length is not None and
- expected_length != len(items)):
- raise ValueError
- return list(items)
- raise CallPatternTooComplex, "'*' argument must be a tuple"
- fixedview = unpackiterable
- listview = unpackiterable
-
- def is_w(self, one, other):
- return one is other
-
- def type(self, item):
- return type(item)
-
+ def unpackiterable(self, it):
+ assert it.is_tuple()
+ items = it.items()
+ return list(items)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit