-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Closed
Copy link
Labels
AstroidRelated to astroidRelated to astroidFalse 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
Description
Bug description
Due to incorrect inference, E1120 can be raised on code that is functional.
Example code:
def get_nums():
nums = ()
if input() == '1':
nums = (1, 2)
return nums
def add(x, y):
return x + y
nums = get_nums()
if nums:
add(*nums) # issue raised here, pylint thinks `nums` will always be `()`
Command used
pylint asd.py --disable=all --enable=E1120
Pylint output
************* Module asd
asd.py:12:4: E1120: No value for argument 'x' in function call (no-value-for-parameter)
asd.py:12:4: E1120: No value for argument 'y' in function call (no-value-for-parameter)
Expected behavior
No issues raised.
Pylint version
pylint 2.17.2
astroid 2.15.2
Python 3.11.2 (main, Feb 16 2023, 02:55:59) [Clang 14.0.0 (clang-1400.0.29.202)]
OS / Environment
MacOS Ventura, 13.2.1
Additional dependencies
No response
Metadata
Metadata
Assignees
Labels
AstroidRelated to astroidRelated to astroidFalse 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