Re: Metaprogramming Example

2008-04-19 Thread [EMAIL PROTECTED]
On 19 avr, 16:34, andrew cooke <[EMAIL PROTECTED]> wrote: > On Apr 18, 4:48 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > [...] > > > Practically, this means that (amongst other niceties) : > > - you can define functions outside classes and use them as instance or > > class methods > > - y

Re: Metaprogramming Example

2008-04-19 Thread Kay Schluehr
On 17 Apr., 14:25, andrew cooke <[EMAIL PROTECTED]> wrote: > PS Is there anywhere that explains why Decorators (in the context of > functions/methods) are so good? We had kind of an inverse discussion a while ago when someone asked about the fate of aspect oriented programming (AOP) in Python. My

Re: Metaprogramming Example

2008-04-19 Thread andrew cooke
On Apr 18, 4:48 am, Bruno Desthuilliers wrote: [...] > Practically, this means that (amongst other niceties) : > - you can define functions outside classes and use them as instance or > class methods > - you can add/replaces methods dynamically on a per-class or > per-instance basis > - you can ac

Re: Metaprogramming Example

2008-04-18 Thread Bruno Desthuilliers
andrew cooke a écrit : > bruno: >> Ho, and yes : one day, you'll get why it's such a good thing to unite >> functions and methods !-) > > me: >> PS Is there anywhere that explains why Decorators (in the context of >> functions/methods) are so good? I've read lots of things saying they >> are good

Re: Metaprogramming Example

2008-04-17 Thread andrew cooke
bruno: > Ho, and yes : one day, you'll get why it's such a good thing to unite > functions and methods !-) me: > PS Is there anywhere that explains why Decorators (in the context of > functions/methods) are so good? I've read lots of things saying they > are good, but no real justification of why

Re: Metaprogramming Example

2008-04-17 Thread [EMAIL PROTECTED]
On 17 avr, 14:25, andrew cooke <[EMAIL PROTECTED]> wrote: > On Apr 17, 7:12 am, "[EMAIL PROTECTED]"<[EMAIL PROTECTED]> wrote: > > [...] > > Thanks very much! > > These are useful pointers. I'll update my code accordingly. > > At one point you pointed out I didn't need parentheses and I agree - I >

Re: Metaprogramming Example

2008-04-17 Thread Paul McGuire
On Apr 17, 7:25 am, andrew cooke <[EMAIL PROTECTED]> wrote: > On Apr 17, 7:12 am, "[EMAIL PROTECTED]"<[EMAIL PROTECTED]> wrote: > > One other question.  I had "foo is False" and you said I need > equality, which is a good point.  However, in any other language "not > foo" would be preferable.  I wa

Re: Metaprogramming Example

2008-04-17 Thread andrew cooke
On Apr 17, 7:12 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: [...] Thanks very much! These are useful pointers. I'll update my code accordingly. At one point you pointed out I didn't need parentheses and I agree - I was using them to avoid having a line continuation backslash (I think I r

Re: Metaprogramming Example

2008-04-17 Thread [EMAIL PROTECTED]
On 17 avr, 04:27, andrew cooke <[EMAIL PROTECTED]> wrote: > Hi, > > Thanks for the help a couple of days ago. I completed what I was > doing and wrote a summary which I've posted > athttp://acooke.org/cute/PythonMeta0.html > (it's kind of long to post here). I hope it might be useful to > someon

Metaprogramming Example

2008-04-16 Thread andrew cooke
Hi, Thanks for the help a couple of days ago. I completed what I was doing and wrote a summary which I've posted at http://acooke.org/cute/PythonMeta0.html (it's kind of long to post here). I hope it might be useful to someone else - it's complete code for a simple metaprogramming task that us