[openstack-dev] [trove][neutron][cinder][swift][ceilometer][nova][keystone][sahara][glance][neutron-lbaas][imm] stylistic changes to code, how do we handle them?

Sergey Lukjanov slukjanov at mirantis.com
Tue Jan 12 14:07:06 UTC 2016


Hi,

IMO if you want to do the stylistic changes - make the hacking rule for it
first. Not all of this particular changes are useful and even correct. The
explicit comparison with zero in Python where we have number of implicit
casts to bool is much better in such cases.

Thanks.

On Tue, Jan 12, 2016 at 5:02 PM, Chris Dent <cdent+os at anticdent.org> wrote:

> On Tue, 12 Jan 2016, Amrith Kumar wrote:
>
> if var > 0:
>>         ... something ...
>>
>> To
>>
>> if var:
>>         ... something ...
>>
>
> I may be missing something but the above is not a stylistic change
> if var can ever be negative. In one of the ceilometer changes[1] for
> example, this change will change the flow of the code. In this
> particular example if some caller do _do_test_iter_images sends
> page_size=-1 bad things will happen. Since it is test code the scope
> of the damage is limited, but I prefer the more explicit > 0.
>
> I've not checked all the reviews but if it is showing up in one
> place seems like it could in others.
>
> [1]
> https://review.openstack.org/#/c/266211/1/ceilometer/tests/unit/image/test_glance.py
>
> --
> Chris Dent               (╯°□°)╯︵┻━┻            http://anticdent.org/
> freenode: cdent                                         tw: @anticdent
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>


-- 
Sincerely yours,
Sergey Lukjanov
Sahara Technical Lead
(OpenStack Data Processing)
Principal Software Engineer
Mirantis Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20160112/dda7fa2d/attachment.html>


More information about the OpenStack-dev mailing list