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.
This commit is contained in:
toofar 2024-11-16 15:54:27 +13:00
parent 6d9563035e
commit 1888944a69
1 changed files with 1 additions and 4 deletions

View File

@ -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"