diff options
author | Antony Lee <anntzer.lee@gmail.com> | 2019-11-17 17:04:34 +0100 |
---|---|---|
committer | Antony Lee <anntzer.lee@gmail.com> | 2019-12-21 11:50:18 +0100 |
commit | 814513ba9ffb1c0c1678b33757e263393b3c12d2 (patch) | |
tree | 908868684fd1d59722ae4961acf0644293fc2316 /sphinx/util/jsdump.py | |
parent | acdcf81599d49de751811269cd428850605224a1 (diff) | |
download | sphinx-git-814513ba9ffb1c0c1678b33757e263393b3c12d2.tar.gz |
Replace `a and b or c` by the more legible `b if a or c`.
Diffstat (limited to 'sphinx/util/jsdump.py')
-rw-r--r-- | sphinx/util/jsdump.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/util/jsdump.py b/sphinx/util/jsdump.py index bfdba170b..2be48a34a 100644 --- a/sphinx/util/jsdump.py +++ b/sphinx/util/jsdump.py @@ -83,7 +83,7 @@ def dumps(obj: Any, key: bool = False) -> str: if obj is None: return 'null' elif obj is True or obj is False: - return obj and 'true' or 'false' + return 'true' if obj else 'false' elif isinstance(obj, (int, float)): return str(obj) elif isinstance(obj, dict): |