Uh oh!
There was an error while loading. Please reload this page.
add support for typing.reveal_type - #12117
Conversation
sobolevn
left a comment
There was a problem hiding this comment.
Awesome! Thanks!
I guess we also need to sync typeshed for this to work properly with 3.11+ in production,right?
| [case testTypingRevealType] | ||
| from typing import reveal_type | ||
| from typing import reveal_type as show_me_the_type |
There was a problem hiding this comment.
optional nit: Let's also try rt = reveal_type and rt(1)
There was a problem hiding this comment.
That actually doesn't work, probably because at the place in semanal where we recognize reveal_type we can't see through assignments yet. Fixing it would probably be a lot more complicated than this PR, so if we think it's worth fixing, we should do it separately. It doesn't seem too important as no user has asked for it so far.
JelleZijlstra
commented
Feb 3, 2022
Yes, I'll update typeshed at some point too. Thanks for the review! I'll add some additional tests. |
Description
Add support for
typing.reveal_type(python/cpython#30646) andtyping_extensions.reveal_type(python/typing#1055).Test Plan
Added two test cases.