[pypy-svn] r14132 - in pypy/dist/pypy/rpython: . test
cfbolz at codespeak.net
cfbolz at codespeak.net
Sun Jul 3 13:59:20 CEST 2005
Author: cfbolz
Date: Sun Jul 3 13:59:20 2005
New Revision: 14132
Modified:
pypy/dist/pypy/rpython/lltype.py
pypy/dist/pypy/rpython/test/test_lltype.py
Log:
(cfbolz,hpk)
implement helper for getting only non-void args from a Function
Modified: pypy/dist/pypy/rpython/lltype.py
==============================================================================
--- pypy/dist/pypy/rpython/lltype.py (original)
+++ pypy/dist/pypy/rpython/lltype.py Sun Jul 3 13:59:20 2005
@@ -266,6 +266,10 @@
return self.RESULT._defl()
return _func(self, _callable=ex)
+ def _trueargs(self):
+ return [arg for arg in self.ARGS if arg is not Void]
+
+
class OpaqueType(ContainerType):
def __init__(self, tag):
Modified: pypy/dist/pypy/rpython/test/test_lltype.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_lltype.py (original)
+++ pypy/dist/pypy/rpython/test/test_lltype.py Sun Jul 3 13:59:20 2005
@@ -261,6 +261,10 @@
py.test.raises(TypeError, pf, 0, 0)
py.test.raises(TypeError, pf, 'a')
+def test_truargs():
+ F = FuncType((Void, Signed, Void, Unsigned), Float)
+ assert Void not in F._trueargs()
+
def test_inconsistent_gc_containers():
A = GcArray(('y', Signed))
S = GcStruct('b', ('y', Signed))
More information about the Pypy-commit
mailing list