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:
parent
6d9563035e
commit
1888944a69
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue