Skip to content

False positive expression-not-assigned when calling functions with no return inside ternary expression #8129

@da-dada

Description

@da-dada

Bug description

def f1():
    pass


def f2():
    pass


test = True
f1() if test else f2()

Configuration

No response

Command used

pylint test.py

Pylint output

test.py:9: [W0106(expression-not-assigned), ] Expression "f1() if test else f2()" is assigned to nothing

Expected behavior

no warning (according to documentation of pylint)

Pylint version

2.16.0.b1

OS / Environment

windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Positive 🦟A message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions