What is Nostr?
Alex Hall /
npub1aue…hwxw
2024-05-01 19:12:05

Alex Hall on Nostr: In Python, this snippet `var = "abc" or None` results in the variable var having the ...

In Python, this snippet

`var = "abc" or None`

results in the variable var having the value "abc". Why? If var is assigned to the result of a binary comparison, and if Python evaluates "abc" as True and None as False, shouldn't var be set to True?
Author Public Key
npub1auen2lhr57j883rfelnw9fv3wklw86pgze9kmm860x3xua559eks6yhwxw