Skip to content

Commit 6b6c3f9

Browse files
julthepsprytnykPierre-Sassoulas
authored
Add documentation examples for too-many-boolean-expressions (#7068)
Co-authored-by: Vladyslav Krylasov <vladyslav.krylasov@gmail.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
1 parent 92002b8 commit 6b6c3f9

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def can_be_divided_by_two_and_are_not_zero(x, y, z):
2+
# Maximum number of boolean expressions in an if statement (by default 5)
3+
if (x and y and z) and (x % 2 == 0 and y % 2 == 0 and z % 2 == 0): # [too-many-boolean-expressions]
4+
pass

doc/data/messages/t/too-many-boolean-expressions/details.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
# This is a placeholder for correct code for this message.
1+
def can_be_divided_by_two_and_are_not_zero(x, y, z):
2+
if all(i and i%2==0 for i in [x, y, z]):
3+
pass

0 commit comments

Comments
 (0)