Skip to content

[docs] Update common_issues.rst: update information about reveal type & locals #19059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

wyattscarpenter
Copy link
Contributor

@wyattscarpenter wyattscarpenter commented May 8, 2025

Previously it was impossible to have these in at run time (more or less), but now you can just import one of them.

Tangential open question I'm curious about: Is there any interest in getting reveal_locals into typing? I've never used it myself, so I have no strong opinions one way or the other, but I'm surprised reveal_type made it in and reveal_locals didn't! I tried to find the history of this decision but gave up.

@wyattscarpenter wyattscarpenter marked this pull request as ready for review May 9, 2025 02:22
@wyattscarpenter wyattscarpenter changed the title Update common_issues.rst: update information about reveal type & locals [docs] Update common_issues.rst: update information about reveal type & locals May 9, 2025
Copy link
Collaborator

@A5rocks A5rocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to find the history of this decision but gave up.

Unsurprising since this was a CPython decision without a PEP or anything :^)

I'm going to guess it was either forgotten or discarded because other type checkers don't implement it. See python/cpython#90572

(this review is just a bunch of nitpicks)

@JelleZijlstra
Copy link
Member

I tried to find the history of this decision but gave up.

I believe this was on the typing-sig mailing list. I initially proposed adding reveal_locals() too but dropped it when there was some opposition.

it doesn't in my local testing, but that's ok because it gracefully degrades down to `normal code`
Ah, nevermind: I actually get a hard error when I try to push that: `py:data reference target not found: typing.reveal_type`.

This reverts commit a852106.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants