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: Parse error improvement forgetting ( after def
Type: enhancement Stage: resolved
Components: Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Carl.Friedrich.Bolz, miss-islington, pablogsal, terry.reedy
Priority: normal Keywords: patch

Created on 2021-11-09 11:15 by Carl.Friedrich.Bolz, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29484 merged Carl.Friedrich.Bolz, 2021-11-09 11:24
Messages (4)
msg406010 - (view) Author: Carl Friedrich Bolz-Tereick (Carl.Friedrich.Bolz) * Date: 2021-11-09 11:15
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.
msg406024 - (view) Author: miss-islington (miss-islington) Date: 2021-11-09 14:03
New changeset 2819e98d1048238bf94dc2ba88ae2455d01861bc by Carl Friedrich Bolz-Tereick in branch 'main':
bpo-45764: improve error message when missing '(' after 'def' (GH-29484)
https://github.com/python/cpython/commit/2819e98d1048238bf94dc2ba88ae2455d01861bc
msg406244 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-11-12 21:56
Pablo, did you intend to backport to 3.10 or should this be closed?
msg406260 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-11-13 00:37
Normally we don't backport new errors to old versions so we can close this. Thanks for the ping!
History
Date User Action Args
2022-04-11 14:59:52adminsetgithub: 89925
2021-11-13 00:37:15pablogsalsetstatus: open -> closed
resolution: fixed
messages: + msg406260

stage: patch review -> resolved
2021-11-12 21:56:26terry.reedysetversions: + Python 3.11
nosy: + pablogsal, terry.reedy

messages: + msg406244

type: enhancement
2021-11-09 14:03:36miss-islingtonsetnosy: + miss-islington
messages: + msg406024
2021-11-09 11:24:33Carl.Friedrich.Bolzsetkeywords: + patch
stage: patch review
pull_requests: + pull_request27735
2021-11-09 11:15:43Carl.Friedrich.Bolzcreate