Skip to content

Unsupported type Type #4405

Description

@mitar

For the following program:

import typing

T = typing.TypeVar('T')
L = typing.TypeVar('L', bound='List')

class List(typing.List[T]):
    def __init__(self, iterable: typing.Iterable = ()) -> None:
        super().__init__(iterable)

    def copy(self: L) -> L:
        return type(self)(self)

I get the following error:

test.py: error: Unsupported type Type["L"]

mypy 0.560

I do not see why it here an error?

Activity

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

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