[docs] [issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

Serhiy Storchaka report at bugs.python.org
Mon Jun 3 03:10:52 EDT 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

> Can we at least switch to PyLong_CheckExact?

This is a behavior change and as such should be preceded by a period of warning.

If we go this way I propose to add a FutureWarning for int subclasses with overridden __index__.

As for turning the deprecated behaviour into TypeErrors, we added yet few deprecation warnings in 3.8. Would not be better to turn all of them into TypeErrors at the same time?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17576>
_______________________________________


More information about the docs mailing list