[pypy-svn] r36705 - pypy/dist/pypy/annotation
fijal at codespeak.net
fijal at codespeak.net
Sun Jan 14 00:23:26 CET 2007
Author: fijal
Date: Sun Jan 14 00:23:25 2007
New Revision: 36705
Modified:
pypy/dist/pypy/annotation/signature.py
Log:
Make the tests pass
Modified: pypy/dist/pypy/annotation/signature.py
==============================================================================
--- pypy/dist/pypy/annotation/signature.py (original)
+++ pypy/dist/pypy/annotation/signature.py Sun Jan 14 00:23:25 2007
@@ -39,13 +39,11 @@
annotation(t.values()[0])))
elif type(t) is types.NoneType:
return s_None
- assert isinstance(t, (type, types.ClassType))
- if t is bool:
+ #assert isinstance(t, (type, types.ClassType))
+ elif t is bool:
return SomeBool()
elif t is int:
return SomeInteger()
- elif issubclass(t, str): # py.lib uses annotated str subclasses
- return SomeString()
elif t is float:
return SomeFloat()
elif t is list:
@@ -63,6 +61,12 @@
elif bookkeeper and t.__module__ != '__builtin__' and t not in bookkeeper.pbctypes:
classdef = bookkeeper.getuniqueclassdef(t)
return SomeInstance(classdef)
+ elif extregistry.is_registered(t):
+ entry = extregistry.lookup(t)
+ entry.bookkeeper = bookkeeper
+ return entry.compute_result_annotation()
+ elif issubclass(t, str): # py.lib uses annotated str subclasses
+ return SomeString()
else:
o = SomeObject()
if t != object:
More information about the Pypy-commit
mailing list