Re: callbacks in python

2008-08-14 Thread Bruno Desthuilliers
Fredrik Lundh a écrit : Bruno Desthuilliers wrote: from functools import partial callback = partial(some_func, x=1, y) callback(z, t=4, u) >>> from functools import partial >>> callback = partial(some_func, x=1, y) File "", line 1 SyntaxError: non-keyword arg after keyword arg Yeps, I

Re: callbacks in python

2008-08-14 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : Alexandru Mosoi a écrit : does anyone know a nice implementation of callbacks in python? i have issues mixing named & unamed parameters. i want build a callback over a function such that some parameters are passed when callback is created and the rest are passed whe

Re: callbacks in python

2008-08-14 Thread Fredrik Lundh
Bruno Desthuilliers wrote: from functools import partial callback = partial(some_func, x=1, y) callback(z, t=4, u) >>> from functools import partial >>> callback = partial(some_func, x=1, y) File "", line 1 SyntaxError: non-keyword arg after keyword arg -- http://mail.python.org/mailman/li

Re: callbacks in python

2008-08-14 Thread Bruno Desthuilliers
Alexandru Mosoi a écrit : does anyone know a nice implementation of callbacks in python? i have issues mixing named & unamed parameters. i want build a callback over a function such that some parameters are passed when callback is created and the rest are passed when the function is called. exam

Re: callbacks in python

2008-08-13 Thread Larry Bates
Alexandru Mosoi wrote: On Aug 14, 12:02 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: your use of the word "callback" is a bit unusual, and your example isn't valid Python code, but it looks as if functools.partial might be what you need: http://docs.python.org/lib/module-functools.html m

Re: callbacks in python

2008-08-13 Thread Alexandru Mosoi
On Aug 14, 12:02 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > your use of the word "callback" is a bit unusual, and your example isn't > valid Python code, but it looks as if functools.partial might be what > you need: > >      http://docs.python.org/lib/module-functools.html my current implemen

Re: callbacks in python

2008-08-13 Thread Larry Bates
Alexandru Mosoi wrote: does anyone know a nice implementation of callbacks in python? i have issues mixing named & unamed parameters. i want build a callback over a function such that some parameters are passed when callback is created and the rest are passed when the function is called. example

Re: callbacks in python

2008-08-13 Thread Fredrik Lundh
Alexandru Mosoi wrote: does anyone know a nice implementation of callbacks in python? i have issues mixing named & unamed parameters. i want build a callback over a function such that some parameters are passed when callback is created and the rest are passed when the function is called. exampl