Re: Duck Typing and **kwds

2007-10-11 Thread Eduardo O. Padoan
On 10/11/07, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > > Hi there. > > I just tried this test: > > > def f(**kwds): > print kwds > > import UserDict > d = UserDict.UserDict(hello="world") > f(**d) > > > And it fails with a TypeError exception ("f() argument after ** must be a > di

Re: Duck Typing and **kwds

2007-10-10 Thread Kay Schluehr
On 11 Okt., 06:05, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > Is that behavior expected? Is there any reason (performance, perhaps?) to > break > duck-typing in this situation? I guess it wasn't considered to be relevant writing a coercion function since there aren't too many dict like types

Duck Typing and **kwds

2007-10-10 Thread Luis Zarrabeitia
Hi there. I just tried this test: def f(**kwds): print kwds import UserDict d = UserDict.UserDict(hello="world") f(**d) And it fails with a TypeError exception ("f() argument after ** must be a dictionary"). I find that weird, as UserDict should support all protocols that dict su