Skip to content

this is type[object], we need it to be 'SpecialForm[Union]' (or something) #53

Open
@github-actions

Description

@github-actions

# TODO: this is type[object], we need it to be 'SpecialForm[Union]' (or something)

This is the similar to the ``types`` module.
"""
import sys
from typing import Type, Union

from typing_extensions import Final as Final_ext

if sys.version_info >= (3, 8):
    from typing import Final, Literal

    LiteralType: Final = type(Literal[1])
    """A type that can be used to check if type hints are a ``typing.Literal`` instance"""

# TODO: this is type[object], we need it to be 'SpecialForm[Union]' (or something)
OldUnionType: Final_ext[Type[object]] = type(Union[str, int])
"""A type that can be used to check if type hints are a ``typing.Union`` instance."""

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions