Re: Distinguishing between functions and methods in a decorator.

2008-02-08 Thread Berteun Damman
On Thu, 07 Feb 2008 18:22:03 +0100, Diez B. Roggisch [EMAIL PROTECTED] wrote: Can you provide an example of what you are actually after? The descriptor-protocol might come to use there. Thanks for your responses. I have read the Descriptor protocol how-to, which clarifies method access on

Re: Distinguishing between functions and methods in a decorator.

2008-02-07 Thread Diez B. Roggisch
Berteun Damman wrote: Hello, I was wondering a bit about the differences between methods and functions. I have the following: def wrap(arg): print type(arg) return arg class C: def f(): pass @wrap def g(): pass def h(): pass print

Distinguishing between functions and methods in a decorator.

2008-02-07 Thread Berteun Damman
Hello, I was wondering a bit about the differences between methods and functions. I have the following: def wrap(arg): print type(arg) return arg class C: def f(): pass @wrap def g(): pass def h(): pass print type(C.f) print type(h) Which gives the

Re: Distinguishing between functions and methods in a decorator.

2008-02-07 Thread Arnaud Delobelle
On Feb 7, 4:10 pm, Berteun Damman [EMAIL PROTECTED] wrote: Hello, I was wondering a bit about the differences between methods and functions. I have the following: def wrap(arg): print type(arg) return arg class C: def f(): pass @wrap def g():

Re: Distinguishing between functions and methods in a decorator.

2008-02-07 Thread Diez B. Roggisch
Berteun Damman schrieb: Hello, I was wondering a bit about the differences between methods and functions. I have the following: def wrap(arg): print type(arg) return arg class C: def f(): pass @wrap def g(): pass def h(): pass