Skip to content

INTERNAL ERROR (AssertionError in check_multi_assignment_from_tuple) with asyncio.gather tuple-unpack into previously-bound variable #21802

Closed as duplicate

Description

@abrahammurciano

Crash Report

INTERNAL ERROR (AssertionError in check_multi_assignment_from_tuple) when tuple-unpacking the result of await asyncio.gather(...) into a variable that was previously bound to an incompatible type.

Traceback

Traceback (most recent call last):
  File "mypy/checker.py", line 765, in accept
  File "mypy/nodes.py", line 1909, in accept
  File "mypy/checker.py", line 3367, in visit_assignment_stmt
  File "mypy/checker.py", line 3419, in check_assignment
  File "mypy/checker.py", line 4182, in check_assignment_to_multiple_lvalues
  File "mypy/checker.py", line 4260, in check_multi_assignment
  File "mypy/checker.py", line 4411, in check_multi_assignment_from_tuple
AssertionError

To Reproduce

import asyncio
from collections.abc import Iterable


async def bar() -> Iterable[int]:
    return ()


async def foo(a: list[int]) -> None:
    b = a
    _, b = await asyncio.gather(bar(), bar())

Your Environment

  • Mypy version used: 2.3.0 (compiled: yes)
  • Python version used: 3.14.0

Activity

  1. correctmost commented on Aug 3, 2026

    @correctmost

    This looks similar to #19920

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions