Thanks to visit codestin.com
Credit goes to github.com

Skip to content

stubgen remove quotes in an argument definition that has a literal type #11222

Description

@sami-evangelista

With the following test.py file:

import typing
def test(x: typing.Literal['abc', 'def']) -> int:
    ...

stubgen removes the quotes around abc in the output pyi file:

$ stubgen test.py
Processed 1 modules
Generated out/test.pyi

$ cat out/test.pyi 
import typing

def test(x: typing.Literal[abc, 'def']) -> int: ...

mypy version:

$ mypy -V
mypy 0.920+dev.bbea3b56297d3d966b9a98900c218df6616fec85

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions