This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Implement typing.assert_type
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: JelleZijlstra Nosy List: AlexWaygood, JelleZijlstra, gvanrossum, hauntsaninja, kj, sobolevn
Priority: normal Keywords: patch

Created on 2022-01-23 05:19 by JelleZijlstra, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30843 merged JelleZijlstra, 2022-01-24 00:37
PR 32069 merged hauntsaninja, 2022-03-23 06:19
Messages (3)
msg411345 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2022-01-23 05:19
Implement typing.assert_type as proposed in https://mail.python.org/archives/list/typing-sig@python.org/thread/MITFQ6Z45RRMXY3HNM66IC3XXS3TA3JN/. This is a special primitive that asserts to the type checker what the type of an expression is.

Tentatively dropping assert_error() based on Eric's feedback.
msg415385 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2022-03-17 03:02
New changeset 96568e995d840c66edb25b6b9d85e4dcccf5a936 by Jelle Zijlstra in branch 'main':
bpo-46480: add typing.assert_type (GH-30843)
https://github.com/python/cpython/commit/96568e995d840c66edb25b6b9d85e4dcccf5a936
msg415921 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2022-03-24 02:15
New changeset 3354245daf89ca2c760c2c3e5b69a571f25073ed by Shantanu in branch 'main':
bpo-46480: rephrase typing.assert_type docs (GH-32069)
https://github.com/python/cpython/commit/3354245daf89ca2c760c2c3e5b69a571f25073ed
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90638
2022-03-24 02:15:13JelleZijlstrasetmessages: + msg415921
2022-03-23 06:19:11hauntsaninjasetnosy: + hauntsaninja

pull_requests: + pull_request30158
2022-03-17 03:04:56JelleZijlstrasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-03-17 03:02:39JelleZijlstrasetmessages: + msg415385
2022-01-24 00:37:59JelleZijlstrasetkeywords: + patch
stage: patch review
pull_requests: + pull_request29024
2022-01-23 05:19:12JelleZijlstracreate