Fwd: PEP: add a `no` keyword as an alias for `not`

---------- Forwarded message --------- From: Daniel Okey-Okoro <danielokeyokoro@gmail.com> Date: Thu, Aug 1, 2019 at 1:24 PM Subject: Re: PEP: add a `no` keyword as an alias for `not` To: Calvin Spealman <cspealma@redhat.com> Good point Calvin, ------------------------------------------------------------ But in many cases, when people write `if not val` they're checking if the val is `None` i.e. `if val is None`, `if val == None` (so in effect it's kind of like they're checking if "something isn't there") I just did a code review. The idea popped in my head after reading code that behaved this way. ------------------------------------------------------------------- Plus, I'm suggesting an alias. In some usecases it would be better to just use `if not val`. i.e. in cases where you are strictly doing True/False assessments not Falsey ( is_empty() ) assessments e.g. None, [], "", 0 ``` Best Intentions, Daniel Okey-Okoro On Thu, Aug 1, 2019, 1:10 PM Calvin Spealman <cspealma@redhat.com> wrote:
-- Best Intentions, Daniel Okey-Okoro.
participants (1)
-
Daniel Okey-Okoro