Commits

Anonymous committed 40580ce

signatures: basestring type

Comments (0)

Files changed (2)

pypy/rlib/test/test_signature.py

         return 3.0
     assert getsig(f) == [model.SomeLongFloat(), model.SomeSingleFloat(), model.SomeFloat()]
 
+def test_basestring():
+    @signature(types.basestring(), returns=types.int())
+    def f(u):
+        return len(u)
+    assert getsig(f) == [model.SomeStringOrUnicode(), model.SomeInteger()]
+
 def test_unicode():
     @signature(types.unicode(), returns=types.int())
     def f(u):
     return model.SomeInteger()
 
 
+def basestring():
+    return model.SomeStringOrUnicode()
+
 def unicode():
     return model.SomeUnicodeString()