Skip to content

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

Closed

Description

@jameslingard
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']

Activity

  1. jameslingard commented on Nov 19, 2009

    jameslingardmannequin
    MannequinAuthor
    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).]

  2. added
    interpreter-core
    type-bug
    on Nov 19, 2009
  3. benjaminp commented on Nov 19, 2009

    @benjaminp
    Contributor

    Fixed in r76416.

  4. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-coretype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions