René's URL Explorer Experiment


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

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:2a546633-3d18-9efc-0d60-7bdd2de6f0fc
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBBCA:BAE90:101851:14D7D0:6A4ECEFB
html-safe-nonceaca41320d22499fedab986fdbf208b951596b1629f96819dcc8cc7a9c02647fa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkNBOkJBRTkwOjEwMTg1MToxNEQ3RDA6NkE0RUNFRkIiLCJ2aXNpdG9yX2lkIjoiNDIxMTk0NDY2NTEyMzgzNTY0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7c2a2a4925826a164f69bb98d0f854eb0f603f1d3dcbca66266c0a98c8d1bebd
hovercard-subject-tagpull_request:284333470
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/13740/files
twitter:imagehttps://avatars.githubusercontent.com/u/662003?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/662003?s=400&v=4
og:image:altThis 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee6a744804e8e70f97b4d5a18a94dcc63db22f97a
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/13740/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F13740%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F13740%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/13740/files
Reloadhttps://github.com/python/cpython/pull/13740/files
Reloadhttps://github.com/python/cpython/pull/13740/files
Please reload this pagehttps://github.com/python/cpython/pull/13740/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/13740/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 34.8k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.6k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
mdickinsonhttps://github.com/mdickinson
python:masterhttps://github.com/python/cpython/tree/master
mdickinson:make-int-and-index-return-types-stricthttps://github.com/mdickinson/cpython/tree/make-int-and-index-return-types-strict
Conversation 10 https://github.com/python/cpython/pull/13740
Commits 2 https://github.com/python/cpython/pull/13740/commits
Checks 0 https://github.com/python/cpython/pull/13740/checks
Files changed https://github.com/python/cpython/pull/13740/files
Please reload this pagehttps://github.com/python/cpython/pull/13740/files
bpo-17576: Strict __int__ and __index__ return types; operator.index always uses __index__ https://github.com/python/cpython/pull/13740/files#top
Show all changes 2 commits https://github.com/python/cpython/pull/13740/files
d94d73e Remove deprecated ability for __int__ and __index__ to return subclas… mdickinson Jun 2, 2019 https://github.com/python/cpython/pull/13740/commits/d94d73eca77a18bca2551ae3bb7850c06e359cc4
9daaefe Misc/NEWS mdickinson Jun 2, 2019 https://github.com/python/cpython/pull/13740/commits/9daaefed0379da8aef0e8be6baf544ff59e15f3e
Clear filters https://github.com/python/cpython/pull/13740/files
Please reload this pagehttps://github.com/python/cpython/pull/13740/files
Please reload this pagehttps://github.com/python/cpython/pull/13740/files
test_copy.py https://github.com/python/cpython/pull/13740/files#diff-e523221c4331dc96024d5c3a51a1c0d8ef2d11aa4ff0429d9fa286d054189bbb
test_getargs2.py https://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
test_index.py https://github.com/python/cpython/pull/13740/files#diff-8e6df018c1433056e9846b083c5de2759701fc4c9fad2be8afc67d66d25674e1
test_int.py https://github.com/python/cpython/pull/13740/files#diff-18ccbdfd8076e3f5b7f84f250e7f312799c3db073d3c8e351f5ce4ad18d3c304
2019-06-02-11-52-03.bpo-17576.l-SSM4.rst https://github.com/python/cpython/pull/13740/files#diff-ff6dc3b59b05e9a2595d71fd4c3d622a38aad37edeb179b213567b8d11e4bae6
abstract.c https://github.com/python/cpython/pull/13740/files#diff-d2c90d06d281ca8dd7ac8b90109fc26755f7319dd209b5f9416efdecfa56e289
longobject.c https://github.com/python/cpython/pull/13740/files#diff-1a6e70e2beeecad88840c67284ac4d54a36998029244771fcc820e801390726a
Lib/test/test_copy.pyhttps://github.com/python/cpython/pull/13740/files#diff-e523221c4331dc96024d5c3a51a1c0d8ef2d11aa4ff0429d9fa286d054189bbb
View file https://github.com/mdickinson/cpython/blob/9daaefed0379da8aef0e8be6baf544ff59e15f3e/Lib/test/test_copy.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/13740/{{ revealButtonHref }}
https://github.com/python/cpython/pull/13740/files#diff-e523221c4331dc96024d5c3a51a1c0d8ef2d11aa4ff0429d9fa286d054189bbb
https://github.com/python/cpython/pull/13740/files#diff-e523221c4331dc96024d5c3a51a1c0d8ef2d11aa4ff0429d9fa286d054189bbb
Lib/test/test_getargs2.pyhttps://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
View file https://github.com/mdickinson/cpython/blob/9daaefed0379da8aef0e8be6baf544ff59e15f3e/Lib/test/test_getargs2.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/13740/{{ revealButtonHref }}
https://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
https://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
https://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
https://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
https://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
https://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
https://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
https://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
https://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
mdickinsonhttps://github.com/mdickinson
Jun 2, 2019https://github.com/python/cpython/pull/13740/files#r289637149
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/13740/files
https://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
https://github.com/python/cpython/pull/13740/files#diff-f44b47da714dd7689d4a6053a90872f022586917d1f579d22276c7165d812b02
Lib/test/test_index.pyhttps://github.com/python/cpython/pull/13740/files#diff-8e6df018c1433056e9846b083c5de2759701fc4c9fad2be8afc67d66d25674e1
View file https://github.com/mdickinson/cpython/blob/9daaefed0379da8aef0e8be6baf544ff59e15f3e/Lib/test/test_index.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/13740/{{ revealButtonHref }}
https://github.com/python/cpython/pull/13740/files#diff-8e6df018c1433056e9846b083c5de2759701fc4c9fad2be8afc67d66d25674e1
mdickinsonhttps://github.com/mdickinson
Jun 2, 2019https://github.com/python/cpython/pull/13740/files#r289637195
Please reload this pagehttps://github.com/python/cpython/pull/13740/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/13740/files
https://github.com/python/cpython/pull/13740/files#diff-8e6df018c1433056e9846b083c5de2759701fc4c9fad2be8afc67d66d25674e1
https://github.com/python/cpython/pull/13740/files#diff-8e6df018c1433056e9846b083c5de2759701fc4c9fad2be8afc67d66d25674e1
Lib/test/test_int.pyhttps://github.com/python/cpython/pull/13740/files#diff-18ccbdfd8076e3f5b7f84f250e7f312799c3db073d3c8e351f5ce4ad18d3c304
View file https://github.com/mdickinson/cpython/blob/9daaefed0379da8aef0e8be6baf544ff59e15f3e/Lib/test/test_int.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/13740/{{ revealButtonHref }}
https://github.com/python/cpython/pull/13740/files#diff-18ccbdfd8076e3f5b7f84f250e7f312799c3db073d3c8e351f5ce4ad18d3c304
https://github.com/python/cpython/pull/13740/files#diff-18ccbdfd8076e3f5b7f84f250e7f312799c3db073d3c8e351f5ce4ad18d3c304
Misc/NEWS.d/next/Core and Builtins/2019-06-02-11-52-03.bpo-17576.l-SSM4.rsthttps://github.com/python/cpython/pull/13740/files#diff-ff6dc3b59b05e9a2595d71fd4c3d622a38aad37edeb179b213567b8d11e4bae6
View file https://github.com/mdickinson/cpython/blob/9daaefed0379da8aef0e8be6baf544ff59e15f3e/Misc/NEWS.d/next/Core%20and%20Builtins/2019-06-02-11-52-03.bpo-17576.l-SSM4.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/13740/{{ revealButtonHref }}
Objects/abstract.chttps://github.com/python/cpython/pull/13740/files#diff-d2c90d06d281ca8dd7ac8b90109fc26755f7319dd209b5f9416efdecfa56e289
View file https://github.com/mdickinson/cpython/blob/9daaefed0379da8aef0e8be6baf544ff59e15f3e/Objects/abstract.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/13740/{{ revealButtonHref }}
https://github.com/python/cpython/pull/13740/files#diff-d2c90d06d281ca8dd7ac8b90109fc26755f7319dd209b5f9416efdecfa56e289
mdickinsonhttps://github.com/mdickinson
Jun 2, 2019https://github.com/python/cpython/pull/13740/files#r289637220
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/13740/files
https://github.com/python/cpython/pull/13740/files#diff-d2c90d06d281ca8dd7ac8b90109fc26755f7319dd209b5f9416efdecfa56e289
Objects/longobject.chttps://github.com/python/cpython/pull/13740/files#diff-1a6e70e2beeecad88840c67284ac4d54a36998029244771fcc820e801390726a
View file https://github.com/mdickinson/cpython/blob/9daaefed0379da8aef0e8be6baf544ff59e15f3e/Objects/longobject.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/13740/{{ revealButtonHref }}
https://github.com/python/cpython/pull/13740/files#diff-1a6e70e2beeecad88840c67284ac4d54a36998029244771fcc820e801390726a
https://github.com/python/cpython/pull/13740/files#diff-1a6e70e2beeecad88840c67284ac4d54a36998029244771fcc820e801390726a
https://github.com/python/cpython/pull/13740/files#diff-1a6e70e2beeecad88840c67284ac4d54a36998029244771fcc820e801390726a
https://github.com/python/cpython/pull/13740/files#diff-1a6e70e2beeecad88840c67284ac4d54a36998029244771fcc820e801390726a
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.