René's URL Explorer Experiment


Title: AssertionError: Must not defer during final iteration · Issue #17716 · python/mypy · GitHub

Open Graph Title: AssertionError: Must not defer during final iteration · Issue #17716 · python/mypy

X Title: AssertionError: Must not defer during final iteration · Issue #17716 · python/mypy

Description: Crash Report this could be related to #15927, but that ticket is related to python 3.10; mine is specific to python 3.13's new TypeVar(..., default=...) argument (the default argument is why i chose python 3.13 for my project 😃). the min...

Open Graph Description: Crash Report this could be related to #15927, but that ticket is related to python 3.10; mine is specific to python 3.13's new TypeVar(..., default=...) argument (the default argument is why i chos...

X Description: Crash Report this could be related to #15927, but that ticket is related to python 3.10; mine is specific to python 3.13's new TypeVar(..., default=...) argument (the default argument is why i ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AssertionError: Must not defer during final iteration","articleBody":"**Crash Report**\r\n\r\nthis could be related to #15927, but that ticket is related to python 3.10; mine is specific to python 3.13's new `TypeVar(..., default=...)` argument (the default argument is why i chose python 3.13 for my project :smiley:).\r\n\r\nthe minimal example below in the appropriate section uses `TypeVar` and `Generic` and produces a crash. i saw the traceback requesting that i try again on the main branch, pulled the main branch and tried again, and the traceback occurred again. so here it is!\r\n\r\nSpecifically, to get the mypy main branch, i did `git clone`, then from inside my project i did `poetry add ../../mypy`\r\n\r\n**Traceback**\r\n\r\n```\r\n$ poetry run mypy --strict --show-traceback craftgrid/game_node.py \r\ncraftgrid/game_node.py:4: error: INTERNAL ERROR -- Please try using mypy master on GitHub:\r\nhttps://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build\r\nPlease report a bug at https://github.com/python/mypy/issues\r\nversion: 1.12.0+dev.fe15ee69b9225f808f8ed735671b73c31ae1bed8\r\nTraceback (most recent call last):\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/bin/mypy\", line 8, in \u003cmodule>\r\n    sys.exit(console_entry())\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/__main__.py\", line 15, in console_entry\r\n    main()\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/main.py\", line 102, in main\r\n    res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/main.py\", line 186, in run_build\r\n    res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/build.py\", line 193, in build\r\n    result = _build(\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/build.py\", line 268, in _build\r\n    graph = dispatch(sources, manager, stdout)\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/build.py\", line 2950, in dispatch\r\n    process_graph(graph, manager)\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/build.py\", line 3348, in process_graph\r\n    process_stale_scc(graph, scc, manager)\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/build.py\", line 3443, in process_stale_scc\r\n    mypy.semanal_main.semantic_analysis_for_scc(graph, scc, manager.errors)\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/semanal_main.py\", line 93, in semantic_analysis_for_scc\r\n    process_top_levels(graph, scc, patches)\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/semanal_main.py\", line 220, in process_top_levels\r\n    deferred, incomplete, progress = semantic_analyze_target(\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/semanal_main.py\", line 351, in semantic_analyze_target\r\n    analyzer.refresh_partial(\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/semanal.py\", line 619, in refresh_partial\r\n    self.refresh_top_level(node)\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/semanal.py\", line 630, in refresh_top_level\r\n    self.accept(d)\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/semanal.py\", line 7087, in accept\r\n    node.accept(self)\r\n    ~~~~~~~~~~~^^^^^^\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/nodes.py\", line 1183, in accept\r\n    return visitor.visit_class_def(self)\r\n           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/semanal.py\", line 1700, in visit_class_def\r\n    self.analyze_class(defn)\r\n    ~~~~~~~~~~~~~~~~~~^^^^^^\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/semanal.py\", line 1828, in analyze_class\r\n    self.defer()\r\n    ~~~~~~~~~~^^\r\n  File \"/home/violet/git/violet/games/craftgrid/py/.venv/lib/python3.13/site-packages/mypy/semanal.py\", line 6742, in defer\r\n    assert not self.final_iteration, \"Must not defer during final iteration\"\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^\r\nAssertionError: Must not defer during final iteration\r\ncraftgrid/game_node.py:4: : note: use --pdb to drop into pdb\r\n```\r\n\r\n**To Reproduce**\r\n\r\n```python\r\nfrom typing import TypeVar, Generic\r\n\r\n\r\nclass GameNode(Generic['GameNodeType']):\r\n    pass\r\n\r\n\r\nGameNodeType = TypeVar('GameNodeType', bound=GameNode, default=GameNode)\r\n```\r\n\r\n**Your Environment**\r\n\r\n- Mypy version used: newest from main branch as of right now, `1.12.0+dev.fe15ee69b9225f808f8ed735671b73c31ae1bed8`\r\n- Mypy command-line flags: `poetry run mypy --strict --show-traceback craftgrid/game_node.py`\r\n- Mypy configuration options from `mypy.ini` (and other config files):\r\n- Python version used: `3.13.0rc1`\r\n- Operating system and version: `6.6.41-gentoo-dist`\r\n","author":{"url":"https://github.com/violet4","@type":"Person","name":"violet4"},"datePublished":"2024-08-29T01:32:11Z","url":"https://github.com/python/mypy/issues/17716"}

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:3c2ae7c3-d49e-baa4-22de-13cdded1def2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBD0A:1AC37C:3E035B:534C78:6B002AFB
html-safe-nonced30d928fcee796fb3681bf2194025f017df4fd9e21bbaba2a3180a353468307f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDBBOjFBQzM3QzozRTAzNUI6NTM0Qzc4OjZCMDAyQUZCIiwidmlzaXRvcl9pZCI6IjEyNjQ0ODQ3NDY0OTk0NjgwMjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaceffa8fbdaef809505bb271a4d61f067f75c442d413a89d40c72bb91452cfa2ce
hovercard-subject-tagissue:2493268620
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/17716/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2eeeec7cf34668a860dc44079627e8289b92dfec369a374f44974519ba21a46d/python/mypy/issues/17716
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2eeeec7cf34668a860dc44079627e8289b92dfec369a374f44974519ba21a46d/python/mypy/issues/17716
og:image:altCrash Report this could be related to #15927, but that ticket is related to python 3.10; mine is specific to python 3.13's new TypeVar(..., default=...) argument (the default argument is why i chos...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameviolet4
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
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
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/17716#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F17716
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%2F17716
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/17716
Reloadhttps://github.com/python/mypy/issues/17716
Reloadhttps://github.com/python/mypy/issues/17716
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 requests547 (547)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/17716
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/17716
#21491https://github.com/python/mypy/pull/21491
AssertionError: Must not defer during final iterationhttps://github.com/python/mypy/issues/17716#top
#21491https://github.com/python/mypy/pull/21491
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
topic-pep-696TypeVar defaultshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-pep-696%22
topic-recursive-typeshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-recursive-types%22
https://github.com/violet4
violet4https://github.com/violet4
on Aug 29, 2024https://github.com/python/mypy/issues/17716#issue-2493268620
#15927https://github.com/python/mypy/issues/15927
violet4https://github.com/violet4
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
on Aug 29, 2024https://github.com/python/mypy/issues/17716#event-14054619143
sterliakovhttps://github.com/sterliakov
topic-pep-696TypeVar defaultshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-pep-696%22
on Sep 2, 2025https://github.com/python/mypy/issues/17716#event-19450048183
https://github.com/wyattscarpenter
wyattscarpenterhttps://github.com/wyattscarpenter
on Sep 23, 2025https://github.com/python/mypy/issues/17716#issuecomment-3325030332
https://gist.github.com/mypy-play/eed8c069d307071718ae2692366f2136https://gist.github.com/mypy-play/eed8c069d307071718ae2692366f2136
https://mypy-play.net/?mypy=master&python=3.14&gist=eed8c069d307071718ae2692366f2136https://mypy-play.net/?mypy=master&python=3.14&gist=eed8c069d307071718ae2692366f2136
sterliakovhttps://github.com/sterliakov
topic-recursive-typeshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-recursive-types%22
on Nov 7, 2025https://github.com/python/mypy/issues/17716#event-20797420940
RiyaPrabhakar-githttps://github.com/RiyaPrabhakar-git
GC-Content-Calculatorhttps://github.com/users/RiyaPrabhakar-git/projects/1
on Dec 12, 2025https://github.com/python/mypy/issues/17716#event-21527490303
github-project-automationhttps://github.com/apps/github-project-automation
GC-Content-Calculatorhttps://github.com/users/RiyaPrabhakar-git/projects/1
on Dec 12, 2025https://github.com/python/mypy/issues/17716
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jan 29, 2026https://github.com/python/mypy/issues/17716#issuecomment-3817728797
@cdce8phttps://github.com/cdce8p
https://github.com/cdce8p
cdce8phttps://github.com/cdce8p
on Jan 29, 2026https://github.com/python/mypy/issues/17716#issuecomment-3819947139
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jan 29, 2026https://github.com/python/mypy/issues/17716#issuecomment-3820334222
ilevkivskyihttps://github.com/ilevkivskyi
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#21491https://github.com/python/mypy/pull/21491
on May 26, 2026https://github.com/python/mypy/issues/17716#event-25966008096
ilevkivskyihttps://github.com/ilevkivskyi
on May 26, 2026https://github.com/python/mypy/issues/17716#event-25966008156
Fix various crashes on recursive type variable defaults (#21491)https://github.com/python/mypy/commit/47ca4c247c38b77a1267b12127db1eee6c89487a
#21491https://github.com/python/mypy/pull/21491
47ca4c2https://github.com/python/mypy/commit/47ca4c247c38b77a1267b12127db1eee6c89487a
https://github.com/violet4
violet4https://github.com/violet4
on May 27, 2026https://github.com/python/mypy/issues/17716#issuecomment-4558533714
@ilevkivskyihttps://github.com/ilevkivskyi
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/17716
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/17716
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
topic-pep-696TypeVar defaultshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-pep-696%22
topic-recursive-typeshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-recursive-types%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.