A few small hacks allowed me to pass the issue currently blocking
(attached, why not). Then I thought it got stuck in an infinite loop,
but no, it was merely being very, very slow. It takes about 15
minutes to crash on tismerysoft.de, a 3 Ghz P4, so I'd guess at least
an hour on this machine, maybe quite a bit more than that. I think
what is happening is that *each and every* instance of Function is
having it's run() method analyzed, or something like that. More than
once, because they get reflowed at least once. This is probably not
that good an idea :)
Cheers,
mwh
Index: pypy/annotation/unaryop.py
===================================================================
--- pypy/annotation/unaryop.py (revision 7653)
+++ pypy/annotation/unaryop.py (working copy)
@@ -102,7 +102,10 @@
def iter(str):
return SomeIterator(SomeChar())
+ def join(str, other):
+ return SomeString()
+
class __extend__(SomeChar):
def len(chr):
Index: pypy/annotation/builtin.py
===================================================================
--- pypy/annotation/builtin.py (revision 7653)
+++ pypy/annotation/builtin.py (working copy)
@@ -135,3 +135,4 @@
BUILTIN_ANALYZERS[pypy.objspace.std.restricted_int.r_int] = builtin_int
BUILTIN_ANALYZERS[pypy.objspace.std.restricted_int.r_uint] = restricted_uint
+BUILTIN_ANALYZERS[''.join] = builtin_str
Index: pypy/annotation/factory.py
===================================================================
--- pypy/annotation/factory.py (revision 7653)
+++ pypy/annotation/factory.py (working copy)
@@ -148,7 +148,7 @@
except KeyError:
result = SomePBC({x: True}) # pre-built inst
clsdef = self.getclassdef(new_or_old_class(x))
- for attr in x.__dict__:
+ for attr in getattr(x, '__dict__', []):
clsdef.add_source_for_attribute(attr, x)
self.pbccache[x] = result
return result
@@ -197,10 +197,11 @@
s_instance = SomeInstance(classdef)
# flow into __init__() if the class has got one
init = getattr(cls, '__init__', None)
- if init is not None and init != object.__init__:
- attrdef = classdef.find_attribute('__init__')
- attrdef.getvalue()
- self.pycall(init, s_instance, *args)
+ if init is not None:
+ if isinstance(init.im_func, FunctionType):
+ attrdef = classdef.find_attribute('__init__')
+ attrdef.getvalue()
+ self.pycall(init, s_instance, *args)
else:
assert not args, "no __init__ found in %r" % (cls,)
return s_instance
--
ARTHUR: But which is probably incapable of drinking the coffee.
-- The Hitch-Hikers Guide to the Galaxy, Episode 6
_______________________________________________
[EMAIL PROTECTED]
http://codespeak.net/mailman/listinfo/pypy-dev