Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Before: It was two steps 1) Acquire the method (for example __iadd__). On a C-Level this triggers Base_getattro 2) Then call the return object. However this is not exactly what CPython does on a statement like this: a += 1 CPython looks first at the number protocol of that type. If the number protocol has the slot defined it calls it, otherwise it raises a TypeError. https://docs.python.org/3.6/c-api/typeobj.html?highlight=pynumbermethods#c.PyNumberMethods => CPython omits Base_getattro at all. Now: By using the operator module, the unittests behave exactly as cpython on a statement like this: a += 1
- Loading branch information