Hi Surya
On 20 April 2012 17:32, Surya K wrote:
> I mean, say I defined foo() , bar() methods in a class myClass. So, how
> can we i use foo() in bar(). I tried to use @staticmethod, @classmethod,
> but I am getting some errors..
>
> sometimes saying "unbound " and sometimes "given more than 1 p
On 20/04/12 16:32, Surya K wrote:
I java it really works well.
Java:
this.foo()
Python:
self.foo()
Works almost identically in both.
Of course in Java the 'this' is optional but many style guides
recommend its use to make it clear where the function lives...
If you really like 'this' ove
> I have a class, and want to use a method of it in the class itself.
>
> How can I do it?
>
> I mean, say I defined foo() , bar() methods in a class myClass. So, how
> can we i use foo() in bar(). I tried to use @staticmethod, @classmethod,
> but I am getting some errors..
>
> sometimes saying
Surya K wrote:
I have a class, and want to use a method of it in the class itself. How can
I do it?
I mean, say I defined foo() , bar() methods in a class myClass. So, how can
we i use foo() in bar().
class C:
def foo(self):
print("foo")
def bar(self):
self.foo()
On Fri, Apr 20, 2012 at 11:32 AM, Surya K wrote:
> I have a class, and want to use a method of it in the class itself.
>
> How can I do it?
>
> I mean, say I defined foo() , bar() methods in a class myClass. So, how can
> we i use foo() in bar(). I tried to use @staticmethod, @classmethod, but I
>
I have a class, and want to use a method of it in the class itself.
How can I do it?
I mean, say I defined foo() , bar() methods in a class myClass. So, how can we
i use foo() in bar(). I tried to use @staticmethod, @classmethod, but I am
getting some errors..
sometimes saying "unbound " and so