Skip to content

Convert one-element list to tuple in Python. #126234

@kmrul

Description

@kmrul

Bug report

Bug description:

Input

tuple([1])

Expected output:

(1)

However, I got this:

(1,)

But for multiple element list convert to tuple is working fine.

CPython versions tested on:

3.9, 3.10, 3.11

Operating systems tested on:

Linux, macOS, Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions