Suppose I have the following:
class myClass:
def foo(self):
# do something
How can I call myClass
from inside the class without declaring an new myClass
Object? i.e. I'd like something like
class myClass:
def foo(self):
# do something
if __name__ == '__main__':
# call foo
or without main
:
class myClass:
def foo(self):
# do something
# call foo
Right now I keep getting either the error that self
is not defined, or the error that foo
expects 1
argument but 0
was provided.