So, I did not know what static methods were so i searched it up and i made this
class Calculator:
def __init__(self,num1,num2):
self.num1 = num1
self.num2 = num2
@staticmethod
def add(x,y):
result = x + y
return result
def sub(x,y):
result = x-y
return result
print(Calculator.add(3,4))
print(Calculator.sub(5,7))
My question is why does the sub method works in a static context even without the @staticmethod decorator? Does it have something to do with the fact that the sub method doesn't use self.num1 or self.num2 or am I just implementing this wrong?