Skip to content

INTERNAL ERROR: maximum semantic analysis iteration count reached Found 1 error in 1 file (errors prevented further checking) #18237

Open
@Ryang20718

Description

@Ryang20718

Mypy is crashing in this example (currently works with 1.0.9)
Crash Report

mypy --show-error-codes --show-column-numbers  --show-traceback example/implementation.py
Deferral trace:
    example.implementation:-1
    example.implementation:-1
    example.implementation:-1
    example.implementation:-1
<snip>
    example.implementation:-1

To Reproduce

file to repro

from typing import NamedTuple

class CodecKey(NamedTuple):
    """A key object combines type and version."""

    @staticmethod
    def from_key_str(key: str) -> "CodecKey":
        """Return a CodecKey parsed from a key string.
        A codec key string has a format of f"{type_keytag}/{version}"
        """
        type_keytag, version = key.split("/")
        return CodecKey(type_keytag, version)

Your Environment

  • Mypy version used: 1.13
  • Mypy command-line flags: --show-traceback
  • Mypy configuration options from mypy.ini
[mypy]

[mypy-importlib.*]
follow_imports = skip
follow_imports_for_stubs = True

  • Python version used: 3.10.7
  • Operating system and version: ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashsemantic-analyzerProblems that happen during semantic analysis

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions