[openstack-dev] "if X not in Y" vs. "if not X in Y" consensus?

Dolph Mathews dolph.mathews at gmail.com
Thu Jan 31 14:52:57 UTC 2013


+1 for "X not in Y"

"not X in Y" reads ambiguously to me.


-Dolph


On Thu, Jan 31, 2013 at 8:45 AM, Ray Pekowski <pekowski at gmail.com> wrote:

> On Thu, Jan 31, 2013 at 1:23 AM, Zhongyue Luo <zhongyue.nah at intel.com>wrote:
>
>> Ray, we are only considering in cases when evaluation of membership is
>> needed.
>>
>> The "if not flag" is an boolean evaluation of "flag" itself and has
>> nothing to do with dict.
>>
>>
> In that case, I (sarcastically) promote a counter proposal for negating a
> dictionary membership check.  It must be done in two lines, as follows:
>
>
> flag = key in dict
> if not flag:
>
> The following forms are disallowed due to the desire for conformity:  "if
> key not in dict" and "if not key in dict".
>
> Votes?  :-)
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130131/4e079595/attachment.html>


More information about the OpenStack-dev mailing list