Skip to content

Commit b2cd28a

Browse files
authored
Merge branch 'master' into fix/len_as_condition
2 parents 94b6d3f + 095928c commit b2cd28a

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

CONTRIBUTORS.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,5 @@ contributors:
279279
* Goudcode: contributor
280280

281281
* Paul Renvoise : contributor
282+
283+
* Bluesheeptoken: contributor

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ Release date: TBA
4444

4545
* Relicense logo material under the CC BY-SA 4.0 license.
4646

47+
* Skip `if` expressions from f-strings for the `check_elif` checker
48+
49+
Close #2816
50+
4751

4852
What's New in Pylint 2.3.0?
4953
===========================

pylint/checkers/python3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ class Python3Checker(checkers.BaseChecker):
438438
"range built-in referenced when not iterating",
439439
"range-builtin-not-iterating",
440440
"Used when the range built-in is referenced in a non-iterating "
441-
"context (returns an iterator in Python 3)",
441+
"context (returns a range in Python 3)",
442442
),
443443
"W1639": (
444444
"filter built-in referenced when not iterating",

pylint/extensions/check_elif.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def process_tokens(self, tokens):
4848
def leave_module(self, _):
4949
self._init()
5050

51-
def visit_ifexp(self, _):
51+
def visit_ifexp(self, node):
52+
if isinstance(node.parent, astroid.FormattedValue):
53+
return
5254
self._if_counter += 1
5355

5456
def visit_comprehension(self, node):

0 commit comments

Comments
 (0)