Skip to content

Incorrect reporting of "Module typing has no member LiteralString" #1620

@CarrotManMatt

Description

@CarrotManMatt

Summary

Running with Python == 3.14.0, ty reports that LiteralString not existing in the stdlib typing module when attempting to import it. This is very much untrue, as it has been within the typing module since Python 3.11.

Version

ty 0.0.1-alpha.27

Reproducible Example

import random
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from typing import Final, LiteralString


VALUE: Final[LiteralString] = random.choice(("x", "y"))

print(VALUE)

Metadata

Metadata

Assignees

Labels

diagnosticsRelated to reporting of diagnostics.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions