Title: Crash: Must not defer during final iteration · Issue #20486 · python/mypy · GitHub
Open Graph Title: Crash: Must not defer during final iteration · Issue #20486 · python/mypy
X Title: Crash: Must not defer during final iteration · Issue #20486 · python/mypy
Description: Crash Report Mypy crashed when changing the import path of the parent class. ./langchain_core/language_models/base.py:116: error: INTERNAL ERROR -- Please try using mypy master on GitHub: https://mypy.readthedocs.io/en/stable/common_issu...
Open Graph Description: Crash Report Mypy crashed when changing the import path of the parent class. ./langchain_core/language_models/base.py:116: error: INTERNAL ERROR -- Please try using mypy master on GitHub: https://m...
X Description: Crash Report Mypy crashed when changing the import path of the parent class. ./langchain_core/language_models/base.py:116: error: INTERNAL ERROR -- Please try using mypy master on GitHub: https://m...
Opengraph URL: https://github.com/python/mypy/issues/20486
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash: Must not defer during final iteration","articleBody":"\u003c!--\n Use this form only if mypy reports an \"INTERNAL ERROR\" and/or gives a traceback.\n Please include the traceback and all other messages below (use `mypy --show-traceback`).\n-->\n\n**Crash Report**\n\nMypy crashed when changing the import path of the parent class.\n\n```\n./langchain_core/language_models/base.py:116: error: INTERNAL ERROR -- Please try using mypy master on GitHub:\nhttps://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build\nPlease report a bug at https://github.com/python/mypy/issues\nversion: 1.19.1\n```\n\n**Traceback**\n\n```python-traceback\nTraceback (most recent call last):\n File \"mypy/semanal.py\", line 7568, in accept\n File \"mypy/nodes.py\", line 995, in accept\n File \"mypy/semanal.py\", line 978, in visit_func_def\n File \"mypy/semanal.py\", line 1023, in analyze_func_def\n File \"mypy/semanal.py\", line 7214, in defer\nAssertionError: Must not defer during final iteration\n```\n\nThe crash happens on checking\n```python\nclass BaseLanguageModel(\n RunnableSerializable[LanguageModelInput, LanguageModelOutputVar], ABC\n)\n```\nwhen changing the `RunnableSerializable` import from\n```python\nfrom langchain_core.runnables import Runnable, RunnableSerializable\n```\nto\n```python\nfrom langchain_core.runnables.base import Runnable, RunnableSerializable\n```\n\n**To Reproduce**\n\nSee https://github.com/langchain-ai/langchain/pull/34520\n\n* clone the project\n```sh\ngit clone https://github.com/cbornet/langchain.git\n```\n* checkout PR branch\n```sh\ngit checkout fix-tc\n```\n* go to `core` sub-project\n```\ncd core\n```\n* run mypy (using uv)\n```\nuv run --all-groups mypy . --show-traceback\n```\n\n**Your Environment**\n\n\u003c!-- Include as many relevant details about the environment you experienced the bug in -->\n\n- Mypy version used: 1.18.2, 1.19.1\n- Mypy command-line flags:\n- Mypy configuration options from `pyproject.toml`:\n```toml\nplugins = [\"pydantic.mypy\"]\nstrict = true\nenable_error_code = \"deprecated\"\ndisallow_any_generics = false\n```\n- Python version used: 3.10, 3.11, 3.12, 3.13, 3.14\n- Operating system and version: macOS 15.1, Ubuntu 24.04\n\n\u003c!--\nYou can freely edit this text, please remove all the lines\nyou believe are unnecessary.\n-->\n","author":{"url":"https://github.com/cbornet","@type":"Person","name":"cbornet"},"datePublished":"2025-12-29T10:20:08Z","url":"https://github.com/python/mypy/issues/20486"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:54884050-e5f6-d9b4-efeb-c6cb3a9c15b5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5EA:5875E:23E9EBE:30DBDD7:6B002FDC |
| html-safe-nonce | 0f373142fdd382cd0ebb85207b11bba26666a19116d6c047909f1c8db9389cf9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUVBOjU4NzVFOjIzRTlFQkU6MzBEQkRENzo2QjAwMkZEQyIsInZpc2l0b3JfaWQiOiIyOTM0NjU2MzIyMjc0MDc4Njg0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 041ed1ebd60773103d62899c6880e4d839d0727c3bd0985a1a74ab942c499d32 |
| hovercard-subject-tag | issue:3767015286 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/mypy/20486/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5d9613caa7a8fd592ef82642d32c4a4eb60cf2db476e7fe5f92204247f33da6c/python/mypy/issues/20486 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5d9613caa7a8fd592ef82642d32c4a4eb60cf2db476e7fe5f92204247f33da6c/python/mypy/issues/20486 |
| og:image:alt | Crash Report Mypy crashed when changing the import path of the parent class. ./langchain_core/language_models/base.py:116: error: INTERNAL ERROR -- Please try using mypy master on GitHub: https://m... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cbornet |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width