Open
Description
Bug description
The used-before-assignment
check reports false positive for the combination of multi-item with
statement and tuple target.
import contextlib
@contextlib.contextmanager
def f():
yield ("A", "B")
@contextlib.contextmanager
def g(_):
yield "C"
with f() as (a, b), g(a) as c:
pass
Configuration
No response
Command used
pylint --disable=missing-docstring --disable=invalid-name test.py
Pylint output
************* Module test
test.py:14:22: E0601: Using variable 'a' before assignment (used-before-assignment)
------------------------------------------------------------------
Your code has been rated at 2.86/10 (previous run: 2.86/10, +0.00)
Expected behavior
No error.
Pylint version
pylint 2.15.3
astroid 2.12.10
Python 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]
OS / Environment
No response
Additional dependencies
No response