Skip to content

Setting only * to an empty parameter list gets a wrong error message saying "arguments" instead of "parameters" #21003

Closed as not planned

Description

@hyperkai

*Notes:

  • mypy test.py
  • mypy 1.19.1
  • Python 3.15.0a6

Setting only * to an empty parameter list gets the wrong error message saying "arguments" instead of "parameters" as shown below:

       # ↓
def func(*): ... # Error

error: Named arguments must follow bare *

So, the error message should say "parameters" instead of "arguments" as shown below:

error: Named parameters must follow bare *

Activity

  1. added
    bug
    on Mar 10, 2026
  2. jbbqqf commented on May 9, 2026

    @jbbqqf

    Hi @kavik2002 — triaging the open issue queue. I think the premise here may not be actionable on mypy's side.

    The error message you quoted, Named arguments must follow bare *, is not emitted by mypy — it comes from CPython's parser itself, before mypy ever sees the source. You can confirm with vanilla CPython:

    python3 -c "import ast; ast.parse('def f(*): pass')"
    # SyntaxError: named arguments must follow bare *

    I also ran rg -n 'must follow bare' mypy/ on master (commit b74aae4) and there are no matches in the mypy codebase, which is consistent with the message originating in CPython.

    So the wording change you're proposing would have to land in CPython itself — for example in Parser/parser.c / Parser/Python.gram — not in mypy. (Though note that "argument" vs "parameter" is a long-running terminology debate inside CPython too; rewording an existing SyntaxError is harder to land than adjusting an analyser-tool message.)

    Given this, this issue may be a candidate to close on the mypy tracker. Happy to be wrong if I'm missing somewhere mypy actually re-emits or rewrites this message — point me at the file and I'll dig further.

    (Disclosure: I drafted this comment with help from Claude Code while triaging open issues; the CPython repro above was run manually before posting.)

  3. added
    pending
    on May 10, 2026
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

    bugpending

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions