The Wayback Machine - http://web.archive.org/web/20210103122055/https://github.com/topics/flake8
Skip to content
#

flake8

Here are 202 public repositories matching this topic...

orsinium
orsinium commented Oct 29, 2020

Rule request

Thesis

Detect if both possible results of a ternary operator return the same value.

# bad
# (all results below can be replaced by just `a`)
a if ... else a
a if a is not None else None
a if a != b else b
b if a == b else a

# ok
a if ... else c
a.split() if a is not None else None
a if a != b else c

Reasoning

It is either a bug or unnec

Improve this page

Add a description, image, and links to the flake8 topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the flake8 topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.