summaryrefslogtreecommitdiff
path: root/tests/basics/ifcond.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/ifcond.py')
-rw-r--r--tests/basics/ifcond.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/basics/ifcond.py b/tests/basics/ifcond.py
index 9264aa74d..5eba14342 100644
--- a/tests/basics/ifcond.py
+++ b/tests/basics/ifcond.py
@@ -57,6 +57,20 @@ if not (1,):
else:
print('b')
+# test evaluation of the if-condition with tuples as arguments
+# non-constant tuples should be evaluated even though they will evaluate to true
+
+def f(x):
+ print("f", x)
+
+if (f(1),):
+ print(18)
+
+if (f(2), f(3)):
+ print(19)
+
+# test if-conditions within a function
+
f2 = 0
def f(t1, t2, f1):