I was experimenting with creating function inside classes that work with instances of the class, I am trying to understand why I can't specify the parameter type of the function:
class MyClass:
def __init__(self) -> None:
self.ithink = True
def iwork(self):
if self.ithink: print("I am (and I work)")
def f(i): i.iwork()
def g(i: MyClass): i.iwork()
instance = MyClass()
MyClass.f(instance) #works
MyClass.g(instance) #doesn't