Skip to content

"Missing positional arguments" error reports optional arguments #7527

@ghost

Description

  • Are you reporting a bug, or opening a feature request?

bug

  • Please insert below the code you are checking with mypy,
    or a mock-up repro if the source is private. We would appreciate
    if you try to simplify your case to a minimal repro.
def f(
    a: int,
    b: int = 1,
    c: int = 2,
    d: int = 3,
    e: int = 4):
    pass

f(b=4)
  • What is the actual behavior/output?

a.py:9: error: Missing positional arguments "a", "c", "d", "e" in call to "f"

  • What is the behavior/output you expect?

a.py:9: error: Missing positional argument "a" in call to "f"

It is only necessary to add a, so c, d, and e should not be mentioned in the error.

  • What are the versions of mypy and Python you are using?
    Do you see the same issue after installing mypy from Git master?
Python 3.7.4
mypy 0.730+dev.61cdc95699233a9c20622949fcafcc03f7e31196

Still see the issue with latest mypy.

  • What are the mypy flags you are using? (For example --strict-optional)

none

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy