[Tutor] beginning to code
Steve D'Aprano
steve+python at pearwood.info
Mon Sep 18 20:19:47 EDT 2017
On Mon, 18 Sep 2017 11:00 pm, Rustom Mody wrote:
>> {None, 0, "" {}, []} → False
>> Everything_else → True
>>
>> This mapping is neither obvious nor trivial
>
> Sufficiently non-obvious that I missed the key element:
> {None, 0, "" {}, [], False} → False
I thought it was intentional, because there's nothing more obvious than that
False is false. Unless you're a pedant and completist like me, why even bother
mentioning that False is falsey?
Especially since you left out so many more obvious values.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
More information about the Python-list
mailing list