Created originally on Bitbucket by remarkablerocket
Was already merged in Bitbucket before import, marked as merged by the import user
"Changed in version 3.4: If base is not an instance of int and the base object has a
base.__index__
method, that method is called to obtain an integer for the base. Previous versions used base.__int__
instead of base.__index__
." (from https://docs.python.org/3/library/functions.html#int)
Note that in CPython an error is raised if base.__index__
method does not exist on the non-int base, even if base.__int__
exists. Test amended to confirm this error is raised.