Skip to content

Conversation

@JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Jan 23, 2022

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

Copy link
Contributor

@erictraut erictraut left a comment

Choose a reason for hiding this comment

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

LGTM

@JelleZijlstra
Copy link
Member Author

@gvanrossum this one should also be ready.

@gvanrossum
Copy link
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.)

@JelleZijlstra
Copy link
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
Copy link
Member

gvanrossum commented Feb 2, 2022 via email

@JelleZijlstra
Copy link
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.

@erictraut
Copy link
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.

@JelleZijlstra
Copy link
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.

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