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_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.19.1
Traceback
Traceback (most recent call last):
File "mypy/semanal.py", line 7568, in accept
File "mypy/nodes.py", line 995, in accept
File "mypy/semanal.py", line 978, in visit_func_def
File "mypy/semanal.py", line 1023, in analyze_func_def
File "mypy/semanal.py", line 7214, in defer
AssertionError: Must not defer during final iteration
The crash happens on checking
class BaseLanguageModel(
RunnableSerializable[LanguageModelInput, LanguageModelOutputVar], ABC
)
when changing the RunnableSerializable import from
from langchain_core.runnables import Runnable, RunnableSerializable
to
from langchain_core.runnables.base import Runnable, RunnableSerializable
To Reproduce
See langchain-ai/langchain#34520
git clone https://github.com/cbornet/langchain.git
uv run --all-groups mypy . --show-traceback
Your Environment
- Mypy version used: 1.18.2, 1.19.1
- Mypy command-line flags:
- Mypy configuration options from
pyproject.toml:
plugins = ["pydantic.mypy"]
strict = true
enable_error_code = "deprecated"
disallow_any_generics = false
- Python version used: 3.10, 3.11, 3.12, 3.13, 3.14
- Operating system and version: macOS 15.1, Ubuntu 24.04
Crash Report
Mypy crashed when changing the import path of the parent class.
Traceback
The crash happens on checking
when changing the
RunnableSerializableimport fromto
To Reproduce
See langchain-ai/langchain#34520
coresub-projectYour Environment
pyproject.toml: