Recursive Function In Python Class