Closed
Description
Steps to reproduce
- cat sample.py
def goo(var):
pass
def bar(var):
pass
def foo():
goo(True) if True else bar(False)
- $ pylint sample.py --disable=blacklisted-name,unused-argument,using-constant-test
Current behavior
************* Module sample
sample.py:8:4: W0106: Expression "goo(True) if True else bar(False)" is assigned to nothing (expression-not-assigned)
Your code has been rated at 8.33/10 (previous run: 8.33/10, +0.00)
Expected behavior
There should be no warning when some functionality has to be executed using ternary operator.
Actuall use case, where this message is being raised: https://github.com/sushobhit27/bimap/blob/8b28e6501b96872c109e0a51e4f7e6081bec0c8f/bimap/bimap.py#L57
pylint --version output
$ pylint --version
pylint 2.0.0
astroid 2.0.1
Python 3.6.4 (default, Jan 7 2018, 15:53:53)
[GCC 6.4.0]
Metadata
Metadata
Assignees
Labels
No labels