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

Parse error improvement forgetting ( after def #89925

Closed
cfbolz mannequin opened this issue Nov 9, 2021 · 5 comments
Closed

Parse error improvement forgetting ( after def #89925

cfbolz mannequin opened this issue Nov 9, 2021 · 5 comments
Labels
3.11 bug and security fixes type-feature A feature request or enhancement

Comments

@cfbolz
Copy link
Mannequin

cfbolz mannequin commented Nov 9, 2021

BPO 45764
Nosy @terryjreedy, @cfbolz, @pablogsal, @miss-islington
PRs
  • bpo-45764: improve error message when missing '(' after 'def' #29484
  • 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 = None
    closed_at = <Date 2021-11-13.00:37:15.633>
    created_at = <Date 2021-11-09.11:15:43.750>
    labels = ['type-feature', '3.11']
    title = 'Parse error improvement forgetting ( after def'
    updated_at = <Date 2021-11-13.00:37:15.632>
    user = 'https://github.com/cfbolz'

    bugs.python.org fields:

    activity = <Date 2021-11-13.00:37:15.632>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-11-13.00:37:15.633>
    closer = 'pablogsal'
    components = []
    creation = <Date 2021-11-09.11:15:43.750>
    creator = 'Carl.Friedrich.Bolz'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45764
    keywords = ['patch']
    message_count = 4.0
    messages = ['406010', '406024', '406244', '406260']
    nosy_count = 4.0
    nosy_names = ['terry.reedy', 'Carl.Friedrich.Bolz', 'pablogsal', 'miss-islington']
    pr_nums = ['29484']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue45764'
    versions = ['Python 3.11']

    @cfbolz
    Copy link
    Mannequin Author

    cfbolz mannequin commented Nov 9, 2021

    Something I see beginners make occasionally when defining functions without arguments is this:

    def f:
    ...

    Right now it just gives an "invalid syntax", would be nice to get an "expected '('".

    I will try to give this a go! Should be a matter of making the '(' token an expected one.

    @miss-islington
    Copy link
    Contributor

    New changeset 2819e98 by Carl Friedrich Bolz-Tereick in branch 'main':
    bpo-45764: improve error message when missing '(' after 'def' (GH-29484)
    2819e98

    @terryjreedy
    Copy link
    Member

    Pablo, did you intend to backport to 3.10 or should this be closed?

    @terryjreedy terryjreedy added 3.11 bug and security fixes type-feature A feature request or enhancement labels Nov 12, 2021
    @pablogsal
    Copy link
    Member

    Normally we don't backport new errors to old versions so we can close this. Thanks for the ping!

    @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 bug and security fixes type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants
    @pablogsal @terryjreedy @miss-islington and others