Title: bpo-17576: Strict __int__ and __index__ return types; operator.index always uses __index__ by mdickinson · Pull Request #13740 · python/cpython · GitHub
Open Graph Title: bpo-17576: Strict __int__ and __index__ return types; operator.index always uses __index__ by mdickinson · Pull Request #13740 · python/cpython
X Title: bpo-17576: Strict __int__ and __index__ return types; operator.index always uses __index__ by mdickinson · Pull Request #13740 · python/cpython
Description: This PR: turns the DeprecationWarnings introduced by @serhiy-storchaka in Python 3.4 for non-integer return values from __int__ and __index__ into TypeErrors makes operator.index and PyNumber_Index always 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
Open Graph Description: This PR: turns the DeprecationWarnings introduced by @serhiy-storchaka in Python 3.4 for non-integer return values from __int__ and __index__ into TypeErrors makes operator.index and PyNumber_Inde...
X Description: This PR: turns the DeprecationWarnings introduced by @serhiy-storchaka in Python 3.4 for non-integer return values from __int__ and __index__ into TypeErrors makes operator.index and PyNumber_Inde...
Opengraph URL: https://github.com/python/cpython/pull/13740
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2a546633-3d18-9efc-0d60-7bdd2de6f0fc |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BBCA:BAE90:101851:14D7D0:6A4ECEFB |
| html-safe-nonce | aca41320d22499fedab986fdbf208b951596b1629f96819dcc8cc7a9c02647fa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkNBOkJBRTkwOjEwMTg1MToxNEQ3RDA6NkE0RUNFRkIiLCJ2aXNpdG9yX2lkIjoiNDIxMTk0NDY2NTEyMzgzNTY0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7c2a2a4925826a164f69bb98d0f854eb0f603f1d3dcbca66266c0a98c8d1bebd |
| hovercard-subject-tag | pull_request:284333470 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/13740/files |
| twitter:image | https://avatars.githubusercontent.com/u/662003?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/662003?s=400&v=4 |
| og:image:alt | This PR: turns the DeprecationWarnings introduced by @serhiy-storchaka in Python 3.4 for non-integer return values from __int__ and __index__ into TypeErrors makes operator.index and PyNumber_Inde... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width