[EMAIL PROTECTED]:
> I'd like to have a dictionary (actually a nested dictionary) to call
> these functions so I can avoid if-then-elsing everything. Eath
> dictionary item has three things in it: the function to be called, a
> string to pass to the function (which is also the key to the dict), an
Le Lundi 05 Juin 2006 19:40, Maric Michaud a écrit :
> Le Lundi 05 Juin 2006 19:18, [EMAIL PROTECTED] a écrit :
> > Any thoughts?
>
oups wanted to wirte this :
In [27]: a, b = (lambda : 'works like this'), (lambda *a : a)
In [28]: a(*())
Out[28]: 'works like this'
In [29]: b(*())
Out[29]: ()
-
Le Lundi 05 Juin 2006 19:18, [EMAIL PROTECTED] a écrit :
> Any thoughts?
In [24]: a, b = (lambda : 'works like this'), (lambda a, b : (a,b))
In [25]: a(*())
Out[25]: 'works like this'
In [26]: b(4,3)
Out[26]: (4, 3)
--
_
Maric Michaud
_
Aristote - www.aristote.info
[EMAIL PROTECTED] wrote:
> Hi,
>
> I'm writing a hand-written recursive decent parser for SPICE syntax
> parsing. In one case I have one function that handles a bunch of
> similar cases (you pass the name and the number of tokens you're
> looking for). In another case I have a function that hand