-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation
Milestone
Description
Bug description
from typing import overload
@overload
def f(x: int, y: int) -> tuple[int, int]:
...
@overload
def f(x: int, y: int, z: int) -> tuple[int, int, int]:
...
def f(x: int, y: int, z: int | None = None) -> tuple[int, int] | tuple[int, int, int]:
return (x, y) if z is None else (x, y, z)
def main():
_, _ = f(1, 2)
_, _, _ = f(1, 2, 3)Configuration
Command used
pylint a.pyPylint output
************* Module a
a.py:20: W0632 Possible unbalanced tuple unpacking with sequence defined at line 15: left side has 3 labels, right side has 2 valuesExpected behavior
No error.
Pylint version
pylint 3.3.8
astroid 3.3.11
Python 3.10.9 (main, May 9 2024, 07:44:19) [GCC 13.2.0]OS / Environment
$ uname -a
Linux <hostname> 6.8.0-86-generic #87-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 18:03:36 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Additional dependencies
Metadata
Metadata
Assignees
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation