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?
`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?