Author: Greg Price <[email protected]>
Branch:
Changeset: r59509:8be991aee4e4
Date: 2012-12-19 09:27 -0800
http://bitbucket.org/pypy/pypy/changeset/8be991aee4e4/
Log: signatures: cut basestring, not a valid annotation
diff --git a/pypy/annotation/model.py b/pypy/annotation/model.py
--- a/pypy/annotation/model.py
+++ b/pypy/annotation/model.py
@@ -202,6 +202,10 @@
self.knowntypedata = knowntypedata
class SomeStringOrUnicode(SomeObject):
+ """Base class for shared implementation of SomeString and
SomeUnicodeString.
+
+ Cannot be an annotation."""
+
immutable = True
can_be_None=False
no_nul = False # No NUL character in the string.
diff --git a/pypy/rlib/test/test_signature.py b/pypy/rlib/test/test_signature.py
--- a/pypy/rlib/test/test_signature.py
+++ b/pypy/rlib/test/test_signature.py
@@ -106,12 +106,6 @@
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):
diff --git a/pypy/rlib/types.py b/pypy/rlib/types.py
--- a/pypy/rlib/types.py
+++ b/pypy/rlib/types.py
@@ -21,9 +21,6 @@
return model.SomeInteger()
-def basestring():
- return model.SomeStringOrUnicode()
-
def unicode():
return model.SomeUnicodeString()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit