Skip to content

Binder doesn't work well with Type[...] #4616

Closed
@ilevkivskyi

Description

@ilevkivskyi

This code:

from typing import Union, Type

class C: ...

x: Union[C, Type[C]]

if isinstance(x, type) and issubclass(x, C):
    reveal_type(x)

Shows that the type of x is builtins.type. Ideally it should be Type[C].

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions