I think they actually read like they would mean slightly different things,
which would make them existing as aliases confusing.

I read `if not val` as "If val isn't true" but i would read `if no val` as
"if val does not exist"

On Thu, Aug 1, 2019 at 4:07 PM Daniel Okey-Okoro <danielokeyok...@gmail.com>
wrote:

> I think that adding a `no` keyword as an alias for `not` would make for
> more readable, simple, pythonic code.
>
> Take the below:
>
> ```
> if not val:
>   do_thing_because_value_is_falsy()
> ```
>
> could be (is actually understood as):
>
> ```
> if no val:
>    do_thing_because_value_is_falsy()
> ```
>
> I think this PEP is a work-around for an underlying subtle issue with how
> the `not` operator is used.
>
> It has two use-cases:
>
> 1. as a NOT gate for producing opposite boolean values
>
> ```
> opposite = not regular
> ```
>
> 2. as a sort of  ".is_falsy()"  checker; when used with an if statement.
>
> like the first example.
>
>
> This PEP would make the difference between the two usecases explicit.
>
> Thoughts?
>
> Best Intentions,
> Daniel Okey-Okoro.
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

cspea...@redhat.com  M: +1.336.210.5107
[image: https://red.ht/sig] <https://red.ht/sig>
TRIED. TESTED. TRUSTED. <https://redhat.com/trusted>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/KYKAPXVW74CGTUJRBPHOKZ6ILRD6A6VE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to