Skip to content

Recursive type aliases tracker #7904

Closed
Closed
@srittau

Description

@srittau

Test case:

from typing import TypeAlias

Recursive: TypeAlias = str | list["Recursive"]

def foo(r: Recursive) -> None:
    if not isinstance(r, str):
        foo(r[0])
    if not isinstance(r, list):
        r.casefold()

foo("")
foo(list(""))
foo(list(list(""), ""))

Metadata

Metadata

Assignees

No one assigned

    Labels

    project: feature trackerTracks whether a typing feature can be used in typeshed stubs

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions