Reputation: 21
I apologize, I still don't entirely understand classes in python. Anyway, I have a program like this:
class foo(args):
def __init__(self):
#stuff
self.func(self, var)
def func(self, var):
return things(self, var)
def things(self, var):
##some stuff
My problem is that when I run this It says I am giving 3 arguments when it asks for 2. When I change things by getting rid of the self.func and putting func(self, var) instead, it says I am giving one variable too few. What is going on? Thanks in advance.
EDIT: Thanks for the answer cppcoder, but that doesn't help, because it just spits back saying there are too few args. I used a static variable instead of a function.
Upvotes: 0
Views: 40
Reputation: 23105
self
is an implicit argument and you need not provide it while invoking the function.
You can invoke as func(var)
You can read about this in What is the purpose of self?
Upvotes: 1