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

Zhongyue Luo zhongyue.nah at intel.com
Thu Jan 31 07:23:50 UTC 2013


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.



On Thu, Jan 31, 2013 at 3:03 PM, Ray Pekowski <pekowski at gmail.com> wrote:

> On Wed, Jan 30, 2013 at 11:36 PM, Zhongyue Luo <zhongyue.nah at intel.com>wrote:
>
>> What I'm suggesting is that we should add an entry in HACKING.rst stating
>> we should use "if X not in Y" and prevent mix use of the two.
>>
>
> -1, This just seems like silliness.  I suppose you would disallow this too:
>
> flag = key in dict
> if not flag:
>
> If there some performance or correctness reason, then I'd go with it.
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>


-- 
*Intel SSG/SSD/SOTC/PRC/CITT*
880 Zixing Road, Zizhu Science Park, Minhang District, Shanghai, 200241,
China
+862161166500
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130131/b9e7e387/attachment.html>


More information about the OpenStack-dev mailing list