[PEAK] dispatch.generic broken in CVS?

Andy Gross andy at andygross.org
Mon Dec 6 21:11:16 EST 2004


... Or am I doing something glaringly stupid?  Pathological case:

import dispatch
[dispatch.generic()]
def f(*args):
     pass

[f.when("True")]
def f1(*args):
     print "f1"

$ python2.3 baz.py
Traceback (most recent call last):
   File "baz.py", line 7, in ?
     [f.when("True")]
   File "baz.py", line 7, in ?
     [f.when("True")]
   File "/usr/lib/python2.3/site-packages/protocols/advice.py", line 
289, in tracer
     frm.f_locals[k] = callback(frm,k,v,old_locals)
   File "/usr/lib/python2.3/site-packages/dispatch/__init__.py", line 
77, in callback
     from dispatch.functions import GenericFunction
   File "/usr/lib/python2.3/site-packages/dispatch/functions.py", line 
206, in ?
     class Dispatcher:
   File "/usr/lib/python2.3/site-packages/dispatch/functions.py", line 
397, in Dispatcher
     [parseRule.when([str,unicode])]
AttributeError: 'function' object has no attribute 'when'

Using python 2.4 and PEAK from CVS as of 5 minutes ago.

Thanks,

/arg




More information about the PEAK mailing list