Skip to content

[red-knot] reveal_type should display raw characters #14330

@dhruvmanila

Description

@dhruvmanila

Looking at something like:

from typing import Literal, reveal_type

x: Literal["\n"] = "\n"

reveal_type(x)

We get:

red-knot: Revealed type is `Literal["
  "]` [revealed-type]
Pyright: Type of "e" is "Literal['\n']"
mypy: Revealed type is "Literal['\n']"

I think it would be useful to not render the characters and instead display it as raw instead similar to Pyright and mypy.

Metadata

Metadata

Assignees

Labels

tyMulti-file analysis & type inference

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions