Skip to content

Improve Void #3823

@bartfeenstra

Description

@bartfeenstra

Current problems

  • Code quality tools complain about initializing Void() as argument defaults

Do we have any other sentinel types like Void? Do we even need a generic pattern?

Can we use Literal in type unions and is in checked to avoid errors and keep code simple?

Otherwise, can we make Void a type alias of an internal class that cannot be initialized? Implement __repr__() on the metaclass to make the type look like its alias.

Otherwise, can we alias Void to be an enum member?

Can we use NewType instead of aliases? Because aliases are resolved by Sphinx and when showing types in errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BC breakBreaks backwards compatibility with existing integrationsenhancementNew feature or requestpythonPull requests that update Python code

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions