Skip to content

any reason why ExtendedTraverserVisitor does not set allow_interpreted_subclasses=True? #14736

@akcheung

Description

@akcheung

Feature

I got a TypeError: interpreted classes cannot inherit from compiled when I tried to extend from it. Not sure if this is a bug or not.

To reproduce:

from mypy.parse import parse
from mypy.traverser import ExtendedTraverserVisitor

class FooVisitor(ExtendedTraverserVisitor):
    def visit(self, o: Node) -> bool:
        print("hello")
        return True

parse("print('foo')", None, None, None, Options()).accept(FooVisitor())

Metadata

Metadata

Assignees

No one assigned

    Labels

    featuretopic-pluginsThe plugin API and ideas for new plugins

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions