Skip to content

enh: show more info in reveal_type #3781

Description

@MarcoGorelli
import pandas as pd
import numpy as np
from typing import reveal_type

def main(s: pd.Series[pd.Timedelta]) -> None:
    td = np.timedelta64(1, "D")
    reveal_type(td)
(.venv) mgorelli@marcoslaptop:~/pandas-stubs-dev$ mypy t.py 
t.py:7: note: Revealed type is "numpy.timedelta64[datetime.timedelta]"
Success: no issues found in 1 source file
(.venv) mgorelli@marcoslaptop:~/pandas-stubs-dev$ pyrefly check t.py 
 INFO revealed type: timedelta64[timedelta] [reveal-type]
 --> t.py:7:16
  |
7 |     reveal_type(td)
  |                ----
  |
 INFO 0 errors

I think the mypy output is easier to use for debugging here?

Activity

  1. grievejia commented on Jun 11, 2026

    @grievejia
    Contributor

    We actually used to always reveal fully qualified names back in Pyre1. We ended up moving away from it because we got a lot of complaints about the console output becoming completely unreadable once the types started getting large.

    It’s definitely a tricky balance figuring out how to appease both sides here. We previously threw around the idea of recognizing a second parameter for reveal_type to control the verbosity, but that's not something that's standardized in typing.

    Keeping this open -- if you or anyone else has ideas on how we can cleanly thread the needle between precision and terminal readability, please share your thoughts.

  2. added
    needs-discussionAn issue where it's not clear whether there is a bug or we are behaving as expected.
    on Jun 11, 2026
  3. MarcoGorelli commented on Jun 11, 2026

    @MarcoGorelli
    CollaboratorAuthor

    Thanks

    How about a pyrefly cli flag

  4. yangdanny97 commented on Jun 22, 2026

    @yangdanny97
    Collaborator

    We could have a flag

  5. added
    help wantedLarger than "good first issue", but still well-defined and ready for someone to pick up
    on Jun 22, 2026
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

    configurationhas-open-prhelp wantedLarger than "good first issue", but still well-defined and ready for someone to pick upneeds-discussionAn issue where it's not clear whether there is a bug or we are behaving as expected.quansight

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions