bpo-17576: Strict __int__ and __index__ return types; operator.index always uses __index__#13740
bpo-17576: Strict __int__ and __index__ return types; operator.index always uses __index__#13740mdickinson wants to merge 2 commits into
Conversation
|
This PR should also allow simplifications to many parts of the codebase that currently need to check what type they got back from a |
Sorry, something went wrong.
|
The test failure appears to be due to |
Sorry, something went wrong.
|
Some of these warnings were added in 3.8. We cannot turn them into TypeError in the same version. |
Sorry, something went wrong.
Could you please try rebasing on master to see if it helps. One of the assertion errors in test_asyncio was fixed with #13754 . |
Sorry, something went wrong.
Are you sure? Which ones? The PR removes 3 |
Sorry, something went wrong.
Ah yes, right. Good point. Closing. |
Sorry, something went wrong.
This PR:
DeprecationWarnings introduced by @serhiy-storchaka in Python 3.4 for non-integer return values from__int__and__index__intoTypeErrorsoperator.indexandPyNumber_Indexalways give the same return value as__index__. This fixes the inconsistency reported by @warsaw in bpo-17576.Still working on doc updates and what's-new entries, but making the PR now so that others can review.
https://bugs.python.org/issue17576