Re: Passing Keyword Arguments - Intermittent errors

"Phillip J. Eby" <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]>
Newsgroups gmane.comp.python.peak
Message-ID <[email protected]>
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@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
>[email protected]
>http://www.eby-sarna.com/mailman/listinfo/peak
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.