Object instance methods working in Python