I'm trying to understand how classes and self work. I now have the following code that has one class and functions defined in it.
from typing import Dict, Any
class LearnClasses:
def checks(self) -> Dict[str, Any]:
return {
**self.chk1(),
**self.chk2(),
**self.chk3(),
}
def chk1(self) -> Dict[str, Any]:
chk_id = self.chk1.__name__
return {
f'{chk_id}': "Is"
}
def chk2(self) -> Dict[str, Any]:
chk_id = self.chk1.__name__
return {
f'{chk_id}': "it"
}
def chk3(self) -> Dict[str, Any]:
chk_id = self.chk3.__name__
return {
f'{chk_id}': "working?"
}
Could someone explain how to call the function checks in LearnClass?
I tried LearnClasses.checks() and it didn't work.