Address dead code in lambda ifelse

This commit is contained in:
rocky
2017-10-10 19:05:16 -04:00
parent 92f5981661
commit b4426931ef
4 changed files with 14 additions and 3 deletions

View File

@@ -3,3 +3,14 @@
f = lambda x: 1 if x<2 else 3
f(5)
# If that wasn't enough ...
# Python will create dead code
# in the below. So we must make sure
# not to include the else expression
g = lambda: 1 if True else 3
g()
h = lambda: 1 if False else 3
h()