I am directly calling a method on a class like this:
MyClass.action("Hello World!")
and inside the called method I need to refer to another method:
class MyClass:
def action(data):
print('first')
# vvv How to perform this call?
next_action(data)
def next_action(data):
print('second', data)
Usually, I would use self
to access the method and attributes but by calling the method on the class there is no instance that self
could refer to. How can I still access one method from another in this case?