Skip to content

set operations and unpacking #14259

Closed
@Molkree

Description

@Molkree

Bug Report

Error on a valid code.

To Reproduce

sets = map(set[str], ["aaa", "abb", "acc"])
intersection = set[str].intersection(*sets)

mypy Playground

Actual Behavior

Argument 1 to "intersection" of "set" has incompatible type "*map[Set[str]]"; expected "Set[_T]" [arg-type]

Your Environment

  • Mypy version used: 0.991
  • Mypy command-line flags: --strict (it's present without strict checking as well)
  • Mypy configuration options from mypy.ini (and other config files): None
  • Python version used: 3.11

This issue is present for a bunch of other set methods like union and difference (I guess all of them that accept *s: Iterable[T]).
Possibly related #9706.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions