FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-46479: add typing.reveal_locals by JelleZijlstra · Pull Request #30839 · python/cpython · GitHub

/ cpython Public

bpo-46479: add typing.reveal_locals - #30839

Closed
JelleZijlstra wants to merge 9 commits into
python:mainfrom
JelleZijlstra:reveallocals
Closed

bpo-46479: add typing.reveal_locals#30839
JelleZijlstra wants to merge 9 commits into
python:mainfrom
JelleZijlstra:reveallocals

Conversation

JelleZijlstra commented Jan 23, 2022
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

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

erictraut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

Copy link
Copy Markdown
Member Author

@gvanrossum this one should also be ready.

Copy link
Copy Markdown
Member

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.)

Copy link
Copy Markdown
Member Author

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):

I think we should also add reveal_locals() and assert_type(), to promote, document and standardize them.

@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().

gvanrossum commented Feb 2, 2022 via email

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Contributor

FWIW, I don't feel strongly one way or another about reveal_locals. I suggested it for completeness.

I agree that assert_type is more useful.

Copy link
Copy Markdown
Member Author

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.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL