Replaced if-else statements with ternary expression (#8658)

* Replace if-else with ternary expression

* assign out variable in readouterr() with ternary expression

* assign err variable in readouterr() with ternary expression

* Assign precision with ternary expression

* ternary expression for collected/collecting

* Assign thread_name with ternary expression

* Update AUTHORS

Co-authored-by: Zachary Kneupper <zacharykneupper@Zacharys-MBP.lan>
This commit is contained in:
Zack Kneupper
2021-05-11 05:52:55 -04:00
committed by GitHub
parent 7cec85a37d
commit 045ad5ac2d
6 changed files with 7 additions and 24 deletions

View File

@@ -647,10 +647,7 @@ def _init_checker_class() -> Type["doctest.OutputChecker"]:
exponent: Optional[str] = w.group("exponent1")
if exponent is None:
exponent = w.group("exponent2")
if fraction is None:
precision = 0
else:
precision = len(fraction)
precision = 0 if fraction is None else len(fraction)
if exponent is not None:
precision -= int(exponent)
if float(w.group()) == approx(float(g.group()), abs=10 ** -precision):