What is the problem with the following __iadd__ definition ?
__iadd__
class MyInt: def __init__(self, val): self.val = val def __iadd__(self, other): try: self.val += other except: self.val += other.val
It requires the definition of __add__
__add__
The except statement is not complete
except
It does not return self
self
Trick question, it's fine !