KEMBAR78
`Type[None]` should return `NoneType`, not `Type[NoneType]` · Issue #451 · python/typing · GitHub
Skip to content

Type[None] should return NoneType, not Type[NoneType] #451

@ambv

Description

@ambv

Title says all.

Otherwise there is no other way to alias NoneType on Python 3 (it's no longer in types). mypy doesn't understand that void = type(None) is an alias, and thus void is an invalid type. The only way to do this currently is to write void = Union[None] which is a hack.

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