Skip to content

Detect impossible unpacking? #18783

Open
@ego-thales

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

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