Skip to content

Detect impossible unpacking? #18783

Description

@ego-thales

Hi,

Consider the following code, which passes with no error.

from foo import bar  # type: ignore[import-not-found]

def baz(x: int):
    return bar(*x, **x)

I think it would be neat to have mypy raising error on this, since int cannot be unpacked in any way.

Is it something to consider or am I missing something?

Thanks in advance.
Élie

Activity

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

    bugmypy got something wronggood-second-issuetopic-callsFunction calls, *args, **kwargs, defaults

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions