from __pypy__ import tproxy def f(operation, *args, **kwargs): if operation == '__add__': return 42 raise AttributeError i = tproxy(list, f)