Skip to content

Type[Any] and type are not equivalent #2655

Closed
@roganov

Description

@roganov

From typing docs:

Type[Any] is equivalent to Type which in turn is equivalent to type, which is the root of Python’s metaclass hierarchy.

But this code produces error:

from typing import *
y: type
x: Type[Any] = y

error: Incompatible types in assignment (expression has type "type", variable has type Type[Any])

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions