Re: defining a method that could be used as instance or static method

2008-03-10 Thread Gerard Flanagan
On Mar 10, 4:39 pm, Sam <[EMAIL PROTECTED]> wrote: > Hello > > I would like to implement some kind of comparator, that could be > called as instance method, or static method. Here is a trivial pseudo > code of what I would like to execute > > >> class MyClass: > > ...def __init__(self, value):

Re: defining a method that could be used as instance or static method

2008-03-10 Thread Sam
> Did you try that it doesn't work? because it should. Whenever you do > No... -_- I kept on trying things @staticmethod. Thanks for your hint, it works fine! Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: defining a method that could be used as instance or static method

2008-03-10 Thread Diez B. Roggisch
Sam wrote: > Hello > > I would like to implement some kind of comparator, that could be > called as instance method, or static method. Here is a trivial pseudo > code of what I would like to execute > >>> class MyClass: > ...def __init__(self, value): > ...self.value = value > ...