[PEAK] Passing Keyword Arguments - Intermittent errors

Phillip J. Eby pje at telecommunity.com
Wed Sep 17 16:25:35 EDT 2008


Now fixed in SVN r2576.  The problem was that TypeEngine (the 
type-tuples-only dispatcher) didn't handle keyword arguments 
correctly on a type-cache miss.  (For example, if you passed it a 
combination of positional argument types it hadn't seen before.)

At 08:34 PM 9/17/2008 +0100, Tim Parkin wrote:
>I'm seeing errors on multiple systems but not consistently  - I can't
>see a pattern though. Here is an example (that sometimes works)
>
>(py)tim at eliot:~$ python
>Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
>[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
>Type "help", "copyright", "credits" or "license" for more information.
> >>> from peak.rules import *
> >>> @abstract
>... def func(x, **k): pass
>...
> >>> @when(func,(str,))
>... def fstr(x,**k): print x,k
>...
> >>> func('x', s='7')
>Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "<stdin>", line 1, in func
>  File "<stdin>", line 1, in func
>TypeError: callback() got an unexpected keyword argument 's'
>
>_______________________________________________
>PEAK mailing list
>PEAK at eby-sarna.com
>http://www.eby-sarna.com/mailman/listinfo/peak




More information about the PEAK mailing list