[openstack-dev] [nova] 'if foo' vs 'if foo is not None'

Matthew Booth mbooth at redhat.com
Mon Mar 3 15:00:17 UTC 2014


PEP 8, under 'Programming Recommendations' recommends against implicit
comparison to None. This isn't just stylistic, either: we were actually
bitten by it in the VMware driver
(https://bugs.launchpad.net/nova/+bug/1262288). The bug was hard to
spot, and had consequences to resource usage.

However, implicit comparison to None seems to be the default in Nova. Do
I give up mentioning this in reviews, or is this something we care about?

Matt
-- 
Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team

GPG ID:  D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490



More information about the OpenStack-dev mailing list