Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mypy doesn't catch inheritance of outer class #18393

Open
injust opened this issue Dec 31, 2024 · 0 comments
Open

mypy doesn't catch inheritance of outer class #18393

injust opened this issue Dec 31, 2024 · 0 comments
Labels
bug mypy got something wrong topic-runtime-semantics mypy doesn't model runtime semantics correctly

Comments

@injust
Copy link

injust commented Dec 31, 2024

Bug Report

Inheriting from an outer class raises NameError at runtime, but mypy doesn't catch this.

To Reproduce

class Foo:
    class Bar(Foo):
        pass

Expected Behavior

Actual Behavior

Success: no issues found in 1 source file

Your Environment

  • Mypy version used: 1.14.0
  • Python version used: 3.13
@injust injust added the bug mypy got something wrong label Dec 31, 2024
@hauntsaninja hauntsaninja added the topic-runtime-semantics mypy doesn't model runtime semantics correctly label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-runtime-semantics mypy doesn't model runtime semantics correctly
Projects
None yet
Development

No branches or pull requests

2 participants