[PEAK] Error with RuleDispatch on Python 2.5
Alain Poirier
alain.poirier at net-ng.com
Mon Sep 11 10:07:59 EDT 2006
Hi,
Running this code with Python 2.5rc1 :
"""
import dispatch
@dispatch.generic()
def render(s):
pass
class C:
pass
@render.when("isinstance(s, C)")
def render(s):
pass
"""
I've go the following traceback (same error with test_dispatch.py or
test_parsing.py). Any idea how to solve this error ?
"""
Traceback (most recent call last):
File "d.py", line 10, in <module>
@render.when("isinstance(s, C)")
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/functions.py",
line 690, in when
return self._decorate(cond)
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/functions.py",
line 577, in _decorate
cond = self.parseRule(cond,frame=frame) or cond
File "<string>", line 10, in parseRule
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/functions.py",
line 440, in parseRule
return self.parse(rule, frame.f_locals, frame.f_globals)
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/functions.py",
line 323, in parse
from dispatch.predicates import CriteriaBuilder
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/predicates.py",
line 710, in <module>
"expr in Call and expr.function is isinstance"
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/functions.py",
line 690, in when
return self._decorate(cond)
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/functions.py",
line 577, in _decorate
cond = self.parseRule(cond,frame=frame) or cond
File "<string>", line 10, in parseRule
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/functions.py",
line 440, in parseRule
return self.parse(rule, frame.f_locals, frame.f_globals)
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/functions.py",
line 326, in parse
return parse_expr(expr_string,builder)
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/ast_builder.py",
line 383, in parse_expr
return build(builder, parser.expr(expr).totuple(1)[1])
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/ast_builder.py",
line 378, in build
return production[nodelist[0]](builder,nodelist)
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/ast_builder.py",
line 51, in com_binary
return getattr(builder,opname)(items)
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/predicates.py",
line 611, in And
return reduce(operator.and_,[build(self,expr) for expr in items])
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/ast_builder.py",
line 378, in build
return production[nodelist[0]](builder,nodelist)
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/ast_builder.py",
line 111, in comparison
return builder.Compare(nodelist[1], results)
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/predicates.py",
line 597, in Compare
right = ICriterion(Pointer(right.value))
File "/opt/python-2.5rc1/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2100-py2.5-linux-i686.egg/dispatch/strategy.py",
line 541, in __new__
self = int.__new__(cls,id(ob))
OverflowError: long int too large to convert to int
"""
More information about the PEAK
mailing list