diff options
author | toofar <toofar@spalge.com> | 2024-11-16 15:54:27 +1300 |
---|---|---|
committer | toofar <toofar@spalge.com> | 2024-11-23 11:36:14 +1300 |
commit | 1888944a690f9840f193c887ddb201471467f727 (patch) | |
tree | ab8559308dce2c6f02bdb66ad7f3274f4716fec9 | |
parent | 6d9563035e90ec01f68399244af73fbf029f10dd (diff) | |
download | qutebrowser-1888944a690f9840f193c887ddb201471467f727.tar.gz qutebrowser-1888944a690f9840f193c887ddb201471467f727.zip |
minimize conditional expression
review feedback
I've mixed opinions on this. I'm not convinced that ternary expressions
are more readable than an if/else block.
Also if someone passes a string into this function it'll return
"access-paste" now.
-rw-r--r-- | qutebrowser/config/configtypes.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 69288e0f4..a64600652 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -2038,7 +2038,4 @@ class JSClipboardPermission(String, AsBool): return value == "access-paste" def from_bool(self, value: bool) -> str: - if value is True: - return "access-paste" - else: - return "none" + return "access-paste" if value else "none" |