Re: Function wrappers

2008-01-23 Thread Gabriel Genellina
En Thu, 24 Jan 2008 00:16:01 -0200, <[EMAIL PROTECTED]> escribió: > def f( callback, *bar, **bkwar ): > def preg ( callfore, *far, **fkwar ): > return g( callback, callfore, bar, bkwar, far, fkwar ) > return preg > > Does anyone see a way to

Re: function wrappers

2007-10-10 Thread Bruno Desthuilliers
Scott David Daniels a écrit : > Ramon Crehuet wrote: >> def require_int(func): >> def wrapper(arg): >> assert isinstance(arg, int) >> return func(arg) >> return wrapper >> def p1(a): >> print a >> p2 = require_int(p1) >> >> My question is: why do p2 arguments becom

Re: function wrappers

2007-10-10 Thread Scott David Daniels
Ramon Crehuet wrote: > def require_int(func): > def wrapper(arg): > assert isinstance(arg, int) > return func(arg) > return wrapper > def p1(a): > print a > p2 = require_int(p1) > > My question is: why do p2 arguments become wrapper arguments? What is > the flux

Re: function wrappers

2007-10-10 Thread Paul Hankin
On Oct 10, 11:39 am, Ramon Crehuet <[EMAIL PROTECTED]> wrote: > Dear all, > I have a Fortran programming background and I have some difficulties in > understading how function wrappers work. I have delved into the subject > because of the new decorators, but I understand the decorator syntax. My >

Re: function wrappers

2007-10-10 Thread Marc 'BlackJack' Rintsch
On Wed, 10 Oct 2007 12:39:24 +0200, Ramon Crehuet wrote: > def require_int(func): >def wrapper(arg): >assert isinstance(arg, int) >return func(arg) >return wrapper > p1(a): >print a > > p2=require_int(p1) > > My question is: why do p2 arguments become