]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Test for object identity when checking for None in Python
authorClaudio Bley <cbley@av-test.de>
Thu, 22 Aug 2013 09:16:03 +0000 (11:16 +0200)
committerClaudio Bley <cbley@av-test.de>
Fri, 23 Aug 2013 06:12:26 +0000 (08:12 +0200)
commit2a40951148c37dde4689a96fab5009a57214de17
tree6a18c13872921f76617bf3582122e6180e42e873
parent6e172109309db1e8fe1d0cd7ae0f55a25b49a0df
Test for object identity when checking for None in Python

Consistently use "is" or "is not" to compare variables to None,
because doing so is preferrable, as per PEP 8
(http://www.python.org/dev/peps/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
> is not, never the equality operators.
docs/apibuild.py
docs/index.py
examples/python/consolecallback.py
examples/python/dominfo.py
examples/python/domrestore.py
examples/python/domsave.py
examples/python/domstart.py
python/generator.py
python/libvirt-override-virConnect.py
python/libvirt-override-virStream.py