Skip to content

Emit PEP 585 syntax from stubgen #16737

Open
@ktbarrett

Description

@ktbarrett

Feature

stubgen currently does not emit PEP 585 syntax, it should, it is permissible, and typeshed has been using PEP 585 syntax for a long while now.

For example, stubgen outputs the following non-PEP-585 syntax in the most current version.

from typing import Tuple

def get_sim_time() -> Tuple[int, int]: ...

Pitch

stubgen should output PEP-585 syntax.

def get_sim_time() -> tuple[int, int]: ...

Activity

hamdanal

hamdanal commented on Jan 13, 2024

@hamdanal
Collaborator

I have a working prototype of this that I haven't submitted yet. It uses some of the changes made in #16519 so I would like for that PR to get merged first (the other PR is also less controversial so if it is not accepted I don't this will be accepted).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ktbarrett@AlexWaygood@hamdanal

        Issue actions

          Emit PEP 585 syntax from stubgen · Issue #16737 · python/mypy