Welcome to the Treehouse Community
Looking to learn something new?
leonardo valdes12,384 Points
self.value vs self
in the new methods Kenneth wrote, he returns from the special methods by using return int(self). How does it know to use self.value? Could you just put self.value, is there a difference?
Steven Parker221,450 Points
One of the first "magic methods" defined is "
__int__", which is used whenever the object is convert to (or treated as) an integer.
This is the case in the places where "self" is used by itself, so in each of those, the "
__int__" method is implicitly used to get the value.