-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-46479: add typing.reveal_locals #30839
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
Conversation
Part of the documentation was taken from mypy: https://mypy.readthedocs.io/en/stable/common_issues.html#reveal-type
Co-authored-by: Nikita Sobolev <[email protected]>
An introspection helper for type checkers that shows the types of all local variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@gvanrossum this one should also be ready. |
I thought there was less agreement on this? Or is it a done deal now that reveal_type() is in? (Personally I use the latter all the time but I don't think I've ever used reveal_locals(), so I'm rather lukewarm.) |
I'm also not as enthusiastic about this one as reveal_type. The main reason I added it was that you wrote (on typing-sig):
@erictraut and Martin DeMello also supported adding reveal_locals(); others in the typing-sig thread just discussed the implementation or reiterated concerns about reveal_type(). |
IIRC I wrote that after it seemed many people wanted reveal_locals() if we
were going for reveal_type(). I'd be happy to skip it. assert_type() sounds
more useful.
|
I'll send another message to the thread asking people to speak up if they really want reveal_locals(). If nobody likes it we can close this. |
FWIW, I don't feel strongly one way or another about I agree that |
Nobody has spoken out in favor of reveal_locals(), so let's close this. We can always bring it back later if there's more demand. |
An introspection helper for type checkers that shows the types
of all local variables.
Done on top of the #30646 branch so I can cross-reference the documentation.
We should give the typing-sig thread some more time before moving forward with this, but I'm opening this PR now to gather feedback on the implementation.
https://bugs.python.org/issue46479