BPO | [46480](https://bugs.python.org/issue46480) --- | :--- Nosy | @gvanrossum, @JelleZijlstra, @hauntsaninja, @sobolevn, @Fidget-Spinner, @AlexWaygood PRs | python/cpython#30843python/cpython#32069 *Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.* Show more details GitHub fields: ```python assignee = 'https://github.com/JelleZijlstra' closed_at = created_at = labels = ['type-feature', 'library', '3.11'] title = 'Implement typing.assert_type' updated_at = user = 'https://github.com/JelleZijlstra' ``` bugs.python.org fields: ```python activity = actor = 'JelleZijlstra' assignee = 'JelleZijlstra' closed = True closed_date = closer = 'JelleZijlstra' components = ['Library (Lib)'] creation = creator = 'JelleZijlstra' dependencies = [] files = [] hgrepos = [] issue_num = 46480 keywords = ['patch'] message_count = 3.0 messages = ['411345', '415385', '415921'] nosy_count = 6.0 nosy_names = ['gvanrossum', 'JelleZijlstra', 'hauntsaninja', 'sobolevn', 'kj', 'AlexWaygood'] pr_nums = ['30843', '32069'] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue46480' versions = ['Python 3.11'] ```
Activity
JelleZijlstra commentedon Jan 23, 2022
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.
JelleZijlstra commentedon Mar 17, 2022
New changeset 96568e9 by Jelle Zijlstra in branch 'main':
bpo-46480: add typing.assert_type (GH-30843)
96568e9
JelleZijlstra commentedon Mar 24, 2022
New changeset 3354245 by Shantanu in branch 'main':
bpo-46480: rephrase typing.assert_type docs (GH-32069)
3354245