René's URL Explorer Experiment


Title: Unexpected "error: Slice index must be an integer or None" · Issue #2410 · python/mypy · GitHub

Open Graph Title: Unexpected "error: Slice index must be an integer or None" · Issue #2410 · python/mypy

X Title: Unexpected "error: Slice index must be an integer or None" · Issue #2410 · python/mypy

Description: Despite having: class g(): ... def __getitem__(self, index): # type: (Union[int, slice, Callable]) -> Union[IterableWrapper, Any] Running mypy triggers "error: Slice index must be an integer or None" for g()[lambda x: x > 4:].

Open Graph Description: Despite having: class g(): ... def __getitem__(self, index): # type: (Union[int, slice, Callable]) -> Union[IterableWrapper, Any] Running mypy triggers "error: Slice index must be an integer or Non...

X Description: Despite having: class g(): ... def __getitem__(self, index): # type: (Union[int, slice, Callable]) -> Union[IterableWrapper, Any] Running mypy triggers "error: Slice index must be an intege...

Opengraph URL: https://github.com/python/mypy/issues/2410

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unexpected \"error: Slice index must be an integer or None\"","articleBody":"Despite having:\r\n\r\n```\r\n    class g():\r\n    ...\r\n        def __getitem__(self, index):\r\n            # type: (Union[int, slice, Callable]) -> Union[IterableWrapper, Any]\r\n```\r\n\r\nRunning mypy triggers \"error: Slice index must be an integer or None\" for ` g()[lambda x: x > 4:] `.\r\n","author":{"url":"https://github.com/sametmax","@type":"Person","name":"sametmax"},"datePublished":"2016-11-07T10:37:53Z","url":"https://github.com/python/mypy/issues/2410"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:657230d3-2f4a-ad9b-058e-dff4ef2afeb8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9B52:1A2F85:2C11B0:3B81E3:6B0025B2
html-safe-nonce486651894fa5605c7908d9e5f964c1ea03acb1de5cd5729955cd55cd4a2fccac
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjUyOjFBMkY4NToyQzExQjA6M0I4MUUzOjZCMDAyNUIyIiwidmlzaXRvcl9pZCI6IjM3Nzg1NDgyMjU0ODk3NzQwMDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9f4bf5994217ef15b43b1eef0212c0e4dc818d3da84015c4581e5234d9bb50a2
hovercard-subject-tagissue:187677091
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/2410/issue_layout
twitter:imagehttps://opengraph.githubassets.com/95616c6d5ae862b06222945c129d0ef3252219c197dbba5e936791258933f5e5/python/mypy/issues/2410
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/95616c6d5ae862b06222945c129d0ef3252219c197dbba5e936791258933f5e5/python/mypy/issues/2410
og:image:altDespite having: class g(): ... def __getitem__(self, index): # type: (Union[int, slice, Callable]) -> Union[IterableWrapper, Any] Running mypy triggers "error: Slice index must be an integer or Non...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesametmax
hostnamegithub.com
expected-hostnamegithub.com
None4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0
turbo-cache-controlno-preview
go-importgithub.com/python/mypy git https://github.com/python/mypy.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id7053637
octolytics-dimension-repository_nwopython/mypy
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7053637
octolytics-dimension-repository_network_root_nwopython/mypy
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release44c658b24abf00491fb7ae5f56d42c9f38cbeab2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/2410#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F2410
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F2410
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fmypy
Reloadhttps://github.com/python/mypy/issues/2410
Reloadhttps://github.com/python/mypy/issues/2410
Reloadhttps://github.com/python/mypy/issues/2410
pythonhttps://github.com/python
mypyhttps://github.com/python/mypy
Codehttps://github.com/python/mypy
Issues2.7k (2.7k)https://github.com/python/mypy/issues
Pull requests546 (546)https://github.com/python/mypy/pulls
Actionshttps://github.com/python/mypy/actions
Projectshttps://github.com/python/mypy/projects
Wikihttps://github.com/python/mypy/wiki
Security and qualityhttps://github.com/python/mypy/security
Insightshttps://github.com/python/mypy/insights
https://github.com/python/mypy
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/2410
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/2410
#21401https://github.com/python/mypy/pull/21401
Unexpected "error: Slice index must be an integer or None"https://github.com/python/mypy/issues/2410#top
#21401https://github.com/python/mypy/pull/21401
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
false-positivemypy gave an error on correct codehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22false-positive%22
featurehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22feature%22
needs discussionhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22needs%20discussion%22
priority-0-highhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-0-high%22
https://github.com/sametmax
sametmaxhttps://github.com/sametmax
on Nov 7, 2016https://github.com/python/mypy/issues/2410#issue-187677091
Nexthttps://github.com/python/mypy/issues/2410?timeline_page=1
https://github.com/elazarg
elazarghttps://github.com/elazarg
on Nov 7, 2016https://github.com/python/mypy/issues/2410#issuecomment-258831388
https://github.com/sametmax
sametmaxhttps://github.com/sametmax
on Nov 7, 2016https://github.com/python/mypy/issues/2410#issuecomment-258846397
https://github.com/elazarg
elazarghttps://github.com/elazarg
on Nov 7, 2016https://github.com/python/mypy/issues/2410#issuecomment-258847986
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Nov 7, 2016https://github.com/python/mypy/issues/2410#issuecomment-258898836
…https://github.com/python/mypy/issues/2410
https://github.com/elazarg
elazarghttps://github.com/elazarg
on Nov 7, 2016https://github.com/python/mypy/issues/2410#issuecomment-258900546
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Nov 7, 2016https://github.com/python/mypy/issues/2410#issuecomment-258900688
https://github.com/elazarg
elazarghttps://github.com/elazarg
on Nov 7, 2016https://github.com/python/mypy/issues/2410#issuecomment-258901001
python/typing#159https://github.com/python/typing/issues/159
https://github.com/elazarg
elazarghttps://github.com/elazarg
on Nov 7, 2016https://github.com/python/mypy/issues/2410#issuecomment-258901380
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Nov 7, 2016https://github.com/python/mypy/issues/2410#issuecomment-258904995
https://github.com/sametmax
sametmaxhttps://github.com/sametmax
on Nov 7, 2016https://github.com/python/mypy/issues/2410#issuecomment-258912566
@elazarghttps://github.com/elazarg
https://github.com/elazarg
elazarghttps://github.com/elazarg
on Nov 12, 2016https://github.com/python/mypy/issues/2410#issuecomment-260143265
https://mail.python.org/pipermail/python-ideas/2016-November/043630.htmlhttps://mail.python.org/pipermail/python-ideas/2016-November/043630.html
https://github.com/shoyer
shoyerhttps://github.com/shoyer
on Nov 13, 2016https://github.com/python/mypy/issues/2410#issuecomment-260159393
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Nov 13, 2016https://github.com/python/mypy/issues/2410#issuecomment-260159863
https://github.com/elazarg
elazarghttps://github.com/elazarg
on Nov 14, 2016https://github.com/python/mypy/issues/2410#issuecomment-260368029
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Nov 14, 2016https://github.com/python/mypy/issues/2410#issuecomment-260483013
https://github.com/alvis
alvishttps://github.com/alvis
on Mar 25, 2021https://github.com/python/mypy/issues/2410#issuecomment-806513957
@Artimihttps://github.com/Artimi
https://github.com/ksamuel
ksamuelhttps://github.com/ksamuel
on Mar 28, 2021https://github.com/python/mypy/issues/2410#issuecomment-808962006
https://github.com/BvB93
BvB93https://github.com/BvB93
on Jun 17, 2021https://github.com/python/mypy/issues/2410#issuecomment-863091868
emmatypinghttps://github.com/emmatyping
priority-0-highhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-0-high%22
priority-1-normalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-1-normal%22
on Jun 17, 2021https://github.com/python/mypy/issues/2410#event-4905522916
https://github.com/emmatyping
emmatypinghttps://github.com/emmatyping
on Jun 17, 2021https://github.com/python/mypy/issues/2410#issuecomment-863406400
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Jun 17, 2021https://github.com/python/mypy/issues/2410#issuecomment-863422503
python/typing#159https://github.com/python/typing/issues/159
https://github.com/eggplants
eggplantshttps://github.com/eggplants
on Jan 31, 2023https://github.com/python/mypy/issues/2410#issuecomment-1409739649
hauntsaninjahttps://github.com/hauntsaninja
on Feb 20, 2023https://github.com/python/mypy/issues/2410#event-8556438514
Allow SupportsIndex in slice expressionshttps://github.com/hauntsaninja/mypy/commit/6b0630f668f736e57c9b9d83900f3f22a1a2783c
6b0630fhttps://github.com/hauntsaninja/mypy/commit/6b0630f668f736e57c9b9d83900f3f22a1a2783c
hauntsaninjahttps://github.com/hauntsaninja
on Mar 11, 2023https://github.com/python/mypy/issues/2410#event-8724571136
Allow SupportsIndex in slice expressions (#14738)https://github.com/python/mypy/commit/fb6b8bc5a041b7cf114b81a894e7248de9e230ae
#14738https://github.com/python/mypy/pull/14738
fb6b8bchttps://github.com/python/mypy/commit/fb6b8bc5a041b7cf114b81a894e7248de9e230ae
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
on Aug 29, 2023https://github.com/python/mypy/issues/2410#issuecomment-1698045989
PEP 696https://peps.python.org/pep-0696/
https://github.com/joaoe
joaoehttps://github.com/joaoe
on Apr 29, 2024https://github.com/python/mypy/issues/2410#issuecomment-2083826034
https://github.com/Jeitan
Jeitanhttps://github.com/Jeitan
on Apr 29, 2024https://github.com/python/mypy/issues/2410#issuecomment-2083883852
ilevkivskyihttps://github.com/ilevkivskyi
on May 4, 2026https://github.com/python/mypy/issues/2410#event-25151426307
Rely on typeshed/stubs for slice typing (#21401)https://github.com/python/mypy/commit/0007c5267287ba47a3e4acc022ecb149fcf702e2
#21401https://github.com/python/mypy/pull/21401
0007c52https://github.com/python/mypy/commit/0007c5267287ba47a3e4acc022ecb149fcf702e2
ilevkivskyihttps://github.com/ilevkivskyi
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#21401https://github.com/python/mypy/pull/21401
on May 4, 2026https://github.com/python/mypy/issues/2410#event-25151426344
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/2410
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/2410
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
false-positivemypy gave an error on correct codehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22false-positive%22
featurehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22feature%22
needs discussionhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22needs%20discussion%22
priority-0-highhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-0-high%22
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.