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::
|
||||
|
||||
_expr1 = expr1
|
||||
if _expr1 is not None:
|
||||
value1 = _expr1.field.of.interest
|
||||
if expr1 is not None:
|
||||
value1 = expr1.field.of.interest
|
||||
else:
|
||||
value1 = None
|
||||
_expr2 = expr2
|
||||
if _expr2 is not None:
|
||||
value2 = _expr2["field"]["of"]["interest"]
|
||||
if expr2 is not None:
|
||||
value2 = expr2["field"]["of"]["interest"]
|
||||
else:
|
||||
value2 = None
|
||||
_expr3 = expr3
|
||||
if _expr3 is not None:
|
||||
value3 = _expr3
|
||||
if expr3 is not None:
|
||||
value3 = expr3
|
||||
else:
|
||||
_expr4 = expr4
|
||||
if _expr4 is not None:
|
||||
value3 = _expr4
|
||||
if expr4 is not None:
|
||||
value3 = expr4
|
||||
else:
|
||||
value3 = expr5
|
||||
|
||||
|
|
Loading…
Reference in New Issue