From: news at dorb.com (Darrell)
Date: Thu, 27 May 1999 14:03:24 -0400
Subject: Interpolation (was: Keyword calling gotcha ?)
References: <ZbC23.110$H5.1892@newsr1.twcny.rr.com> <AXX23.14$KR2.13445@news.corridex.com> <M2_23.314$H5.3242@newsr1.twcny.rr.com> <7ijqr6$pd7$1@rzsun02.rrz.uni-hamburg.de>
Message-ID: <NQf33.447$H5.3451@newsr1.twcny.rr.com>
Content-Length: 1658
X-UID: 1947                                                 

Let me show my ignorance a bit.
 def a(**x):
...     print x

>>> def b(**x):
...     a(x)

When 'b' calls 'a' it is passing a dictionary while 'a' wants a keyword
thing
that it resolves to a dictionary. Wouldn't be nice if the keyword thing
could
mark the dictionaries it creates. Then just pass them though when it sees
one if the only other choice was an error.

Yes this sounds like a possible programmer trap. Like one of those silent
C++ type conversions.

So as Marko said come up with interpolate(args).

Humm. Marko do you have such a function ?

Thanks
--Darrell

Marko Schulz <4mschulz at informatik.uni-hamburg.de> wrote in message
news:7ijqr6$pd7$1 at rzsun02.rrz.uni-hamburg.de...
> It would be nice to have a way of interpolating sequences in parameter
> lists. In Perl it is done automatically, which causes confusion
> regularly, but it would be nice in Python sometimes too.
>
> If it were done with a new function one could also write a function,
> that computes all base_classes to a class on-the-fly:
>     class Derived( interpolate(base_classes(args)) ):
>        :
>        :
>
> At the moment base_classes may only return one base class. Many
> apply(function,args) could be turned into function( interpolate(args) )
>
> This would be especially nice for those (self,)-Tupels, as it was used
> in the original posting above.
>
> Of cause a nicer syntax oder name than interpolate() might be found.
>
> --
> marko schulz
>               "Die Welt ist gut, die Welt ist schlecht.
>                Ich seh' mehr als ich begreifen kann. Ich sehe in 3-D."
>                                                          '3-D', Extrabreit






