We've been discussing `assert_type()` in https://github.com/python/typing/discussions/1030. I would be interested in standardizing that too.


El mar, 18 ene 2022 a las 12:35, Martin DeMello via Typing-sig (<typing-sig@python.org>) escribió:
This is the first I've heard of reveal_locals! Sounds like a useful thing to add, though, I would be in favour of documenting it on par with reveal_type. Pytype also supports an assert_type function, added based on user requests. It's a check you can leave in your code to ensure the type checker is inferring what you think it is.

martin

On Mon, Jan 17, 2022 at 9:21 AM Eric Traut <eric@traut.com> wrote:
This proposal makes sense to me. I would recommend adding `reveal_locals` as well. It's not used as often as `reveal_type`, but it's kind of a "sister function". They're both described in PEP 484, and AFAIK, all type checkers support both.

-Eric

--
Eric Traut
Contributor to Pyright & Pylance
Microsoft
_______________________________________________
Typing-sig mailing list -- typing-sig@python.org
To unsubscribe send an email to typing-sig-leave@python.org
https://mail.python.org/mailman3/lists/typing-sig.python.org/
Member address: mdemello@google.com
_______________________________________________
Typing-sig mailing list -- typing-sig@python.org
To unsubscribe send an email to typing-sig-leave@python.org
https://mail.python.org/mailman3/lists/typing-sig.python.org/
Member address: jelle.zijlstra@gmail.com