Re: dynamically generated runtime methods & reflection

2007-06-15 Thread Bruno Desthuilliers
Alex Martelli a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> > wrote: > >> Josiah Carlson a écrit : >> (snip) >>> Well, the particular operation is typically called 'currying a >>> function', >> >> it's not 'currying' but 'partial application'. >> >> Currying is somehow the reverse of part

Re: dynamically generated runtime methods & reflection

2007-06-15 Thread Alex Martelli
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Josiah Carlson a écrit : > (snip) > > Well, the particular operation is typically called 'currying a > > function', > > > it's not 'currying' but 'partial application'. > > Currying is somehow the reverse of partial : it's a way of building a >

Re: dynamically generated runtime methods & reflection

2007-06-15 Thread Bruno Desthuilliers
Josiah Carlson a écrit : (snip) > Well, the particular operation is typically called 'currying a > function', it's not 'currying' but 'partial application'. Currying is somehow the reverse of partial : it's a way of building a multiple-args function from single-args functions. -- http://mai

Re: dynamically generated runtime methods & reflection

2007-06-14 Thread Josiah Carlson
Josiah Carlson wrote: > Well, the particular operation is typically called 'currying a > function', and unless you know what to look for, it isn't very easy to > make happen. Replace "make happen" to "discover in the standard library". - Josiah -- http://mail.python.org/mailman/listinfo/pyth

Re: dynamically generated runtime methods & reflection

2007-06-14 Thread Josiah Carlson
Jay Loden wrote: > Josiah Carlson wrote: >> Ahh, so you want to pass the method name to the method that you are >> returning to be called. No problem. >> >> >>> import functools >> >>> >> >>> class foo: >> ... def __getattr__(self, name): >> ... return functools.partial(self.Actual

Re: dynamically generated runtime methods & reflection

2007-06-14 Thread Jay Loden
Josiah Carlson wrote: > > Ahh, so you want to pass the method name to the method that you are > returning to be called. No problem. > > >>> import functools > >>> > >>> class foo: > ... def __getattr__(self, name): > ... return functools.partial(self.ActualMethod, name) > ... >

Re: dynamically generated runtime methods & reflection

2007-06-13 Thread Josiah Carlson
Jay Loden wrote: > Hi all, > > First, apologies if anyone gets this twice, but it took me quite a > while to figure out that Python.org is evidently rejecting all mail > from my mail server because I don't have reverse DNS configured. > Anyway: > > I'm not even sure how to phrase this question pr