Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement typing.assert_type #90638

Closed
JelleZijlstra opened this issue Jan 23, 2022 · 3 comments
Closed

Implement typing.assert_type #90638

JelleZijlstra opened this issue Jan 23, 2022 · 3 comments
Assignees
Labels
3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@JelleZijlstra
Copy link
Member

BPO 46480
Nosy @gvanrossum, @JelleZijlstra, @hauntsaninja, @sobolevn, @Fidget-Spinner, @AlexWaygood
PRs
  • bpo-46480: add typing.assert_type #30843
  • bpo-46480: rephrase typing.assert_type docs #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:

    assignee = 'https://github.com/JelleZijlstra'
    closed_at = <Date 2022-03-17.03:04:56.930>
    created_at = <Date 2022-01-23.05:19:12.643>
    labels = ['type-feature', 'library', '3.11']
    title = 'Implement typing.assert_type'
    updated_at = <Date 2022-03-24.02:15:13.459>
    user = 'https://github.com/JelleZijlstra'

    bugs.python.org fields:

    activity = <Date 2022-03-24.02:15:13.459>
    actor = 'JelleZijlstra'
    assignee = 'JelleZijlstra'
    closed = True
    closed_date = <Date 2022-03-17.03:04:56.930>
    closer = 'JelleZijlstra'
    components = ['Library (Lib)']
    creation = <Date 2022-01-23.05:19:12.643>
    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']

    @JelleZijlstra
    Copy link
    Member Author

    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 JelleZijlstra added the 3.11 only security fixes label Jan 23, 2022
    @JelleZijlstra JelleZijlstra self-assigned this Jan 23, 2022
    @JelleZijlstra JelleZijlstra added 3.11 only security fixes stdlib Python modules in the Lib dir labels Jan 23, 2022
    @JelleZijlstra JelleZijlstra self-assigned this Jan 23, 2022
    @JelleZijlstra JelleZijlstra added type-feature A feature request or enhancement stdlib Python modules in the Lib dir labels Jan 23, 2022
    @JelleZijlstra
    Copy link
    Member Author

    New changeset 96568e9 by Jelle Zijlstra in branch 'main':
    bpo-46480: add typing.assert_type (GH-30843)
    96568e9

    @JelleZijlstra
    Copy link
    Member Author

    New changeset 3354245 by Shantanu in branch 'main':
    bpo-46480: rephrase typing.assert_type docs (GH-32069)
    3354245

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant