PEP 531: simplify code expansion to match original
This commit is contained in:
parent
7371998040
commit
d5969080c7
20
pep-0531.txt
20
pep-0531.txt
|
@ -113,23 +113,19 @@ with 16 or 20 lines of conditional logic really doesn't help matters.
|
||||||
|
|
||||||
Expanding the three examples above that way hopefully helps illustrate that::
|
Expanding the three examples above that way hopefully helps illustrate that::
|
||||||
|
|
||||||
_expr1 = expr1
|
if expr1 is not None:
|
||||||
if _expr1 is not None:
|
value1 = expr1.field.of.interest
|
||||||
value1 = _expr1.field.of.interest
|
|
||||||
else:
|
else:
|
||||||
value1 = None
|
value1 = None
|
||||||
_expr2 = expr2
|
if expr2 is not None:
|
||||||
if _expr2 is not None:
|
value2 = expr2["field"]["of"]["interest"]
|
||||||
value2 = _expr2["field"]["of"]["interest"]
|
|
||||||
else:
|
else:
|
||||||
value2 = None
|
value2 = None
|
||||||
_expr3 = expr3
|
if expr3 is not None:
|
||||||
if _expr3 is not None:
|
value3 = expr3
|
||||||
value3 = _expr3
|
|
||||||
else:
|
else:
|
||||||
_expr4 = expr4
|
if expr4 is not None:
|
||||||
if _expr4 is not None:
|
value3 = expr4
|
||||||
value3 = _expr4
|
|
||||||
else:
|
else:
|
||||||
value3 = expr5
|
value3 = expr5
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue