With the following code :
import typesclass Foo(): def __getitem__(self, x): return xdef new_get(self, x): return x + 1x = Foo()x.__getitem__ = types.MethodType(new_get, x)x.__getitem__(42) will return 43, but x[42] will return 42.
Is there a way to override __getitem__ at instance level in Python?