Re: Method behavior for user-created class instances

2008-07-15 Thread crazychimp132
On Jul 15, 9:53 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 15 juil, 01:24, [EMAIL PROTECTED] wrote: > > > Greetings. > > > I am looking for a way to achieve method behavior for a class I > > created. That is, it has a __call__ method, so can be called like a > > function. But I also w

Re: Method behavior for user-created class instances

2008-07-15 Thread [EMAIL PROTECTED]
On 15 juil, 01:24, [EMAIL PROTECTED] wrote: > Greetings. > > I am looking for a way to achieve method behavior for a class I > created. That is, it has a __call__ method, so can be called like a > function. But I also want it to be treated as a method when it appears > in a class body. You need t

Re: Method behavior for user-created class instances

2008-07-14 Thread crazychimp132
On Jul 14, 9:04 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Greetings. > > > I am looking for a way to achieve method behavior for a class I > > created. That is, it has a __call__ method, so can be called like a > > function. But I also want it to be treated as a met

Re: Method behavior for user-created class instances

2008-07-14 Thread Larry Bates
[EMAIL PROTECTED] wrote: Greetings. I am looking for a way to achieve method behavior for a class I created. That is, it has a __call__ method, so can be called like a function. But I also want it to be treated as a method when it appears in a class body. Eg. class foo: def __call__(self,

Method behavior for user-created class instances

2008-07-14 Thread crazychimp132
Greetings. I am looking for a way to achieve method behavior for a class I created. That is, it has a __call__ method, so can be called like a function. But I also want it to be treated as a method when it appears in a class body. Eg. class foo: def __call__(self, inst): pass class bar: