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

AssertionError in deeply nested class scenario (incremental with warm cache) #2931

Closed
ilevkivskyi opened this issue Mar 1, 2017 · 2 comments

Comments

@ilevkivskyi
Copy link
Member

This is a small remainder of #2535

Example to reproduce: run mypy -i main.py twice (without touching any files in between) where:

  • main.py
import ntcrash
  • ntcrash.py
from typing import NamedTuple

class C:
    def f(self) -> None:
        class D:
            class E:
                def g(self) -> None:
                    A = NamedTuple('A', [('x', int), ('y', int)])
                    self.a = A(1, 1)
        self.c = D.E().a

Possible fix would be to store all "anonymous" classes in globals.

@ilevkivskyi
Copy link
Member Author

One needs to add reveal_type(ntcrash.C().c) between two runs to trigger the crash.

@hauntsaninja
Copy link
Collaborator

I think this is fixed on master, possibly by #10431

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants