Skip to content

Use * instead of Unpack[...] in messages when targeting Python 3.11 or later #16445

Open
@JukkaL

Description

@JukkaL

On Python 3.11 and later it seems better to use the native syntax with * instead of Unpack[...] in various messages.

This is the current behavior:

x: tuple[int, *tuple[int, ...]]
# note: Revealed type is "tuple[builtins.int, Unpack[builtins.tuple[builtins.int, ...]]]"
reveal_type(x)

I'd expect the note to look like this:

Revealed type is "tuple[builtins.int, *builtins.tuple[builtins.int, ...]]"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions