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

Incorrect error message with def((x)=0) #51611

Closed
jameslingard mannequin opened this issue Nov 19, 2009 · 2 comments
Closed

Incorrect error message with def((x)=0) #51611

jameslingard mannequin opened this issue Nov 19, 2009 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@jameslingard
Copy link
Mannequin

jameslingard mannequin commented Nov 19, 2009

BPO 7362
Nosy @benjaminp

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 2009-11-19.22:55:17.223>
created_at = <Date 2009-11-19.20:54:21.242>
labels = ['interpreter-core', 'type-bug']
title = 'Incorrect error message with def((x)=0)'
updated_at = <Date 2009-11-19.22:55:17.178>
user = 'https://bugs.python.org/jameslingard'

bugs.python.org fields:

activity = <Date 2009-11-19.22:55:17.178>
actor = 'benjamin.peterson'
assignee = 'none'
closed = True
closed_date = <Date 2009-11-19.22:55:17.223>
closer = 'benjamin.peterson'
components = ['Interpreter Core']
creation = <Date 2009-11-19.20:54:21.242>
creator = 'james.lingard'
dependencies = []
files = []
hgrepos = []
issue_num = 7362
keywords = []
message_count = 2.0
messages = ['95514', '95515']
nosy_count = 2.0
nosy_names = ['benjamin.peterson', 'james.lingard']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue7362'
versions = ['Python 2.6']

@jameslingard
Copy link
Mannequin Author

jameslingard mannequin commented Nov 19, 2009

def f((x)=0): pass

gives the following incorrect error message:

SyntaxError: non-default argument follows default argument

"def f((x)): pass" is treated exactly the same as "def f(x): pass", so
it would seem sensible for the same to be true if a default value is
used. But if this syntax is disallowed for some reason, the error
message should be fixed.

This appears to be related to bug bpo-1557232.

[Tested on Python 2.6 (r26:66714, Jun 8 2009, 16:07:29).]

@jameslingard jameslingard mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Nov 19, 2009
@benjaminp
Copy link
Contributor

Fixed in r76416.

@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
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant