Skip to content

False positive on mutual recursion involving a type alias #3418

Closed
@JelleZijlstra

Description

@JelleZijlstra

This produces an error but (I think) shouldn't:

from typing import List

class A(object):
    b: 'B'  # E: Invalid type "recurse.B"

B = List[A]

It works fine if I make B a class, even a class inheriting from A. I encountered this in https://github.com/JelleZijlstra/typeshed_client/blob/master/typeshed_client/parser.py#L30 (A is NameInfo and B is NameDict).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions