##// END OF EJS Templates
use 'x is None' instead of 'x == None'...
use 'x is None' instead of 'x == None' The built-in None object is a singleton and it is therefore safe to compare memory addresses with is. It is also faster, how much depends on the object being compared. For a simple type like str I get: | s = "foo" | s = None ----------+-----------+---------- s == None | 0.25 usec | 0.21 usec s is None | 0.17 usec | 0.17 usec
Martin Geisler -
r8527:f9a80054 default
Show More
Name Size Modified Last Commit Author
/ hgext
convert
highlight
inotify
zeroconf
__init__.py Loading ...
acl.py Loading ...
alias.py Loading ...
bookmarks.py Loading ...
bugzilla.py Loading ...
children.py Loading ...
churn.py Loading ...
color.py Loading ...
extdiff.py Loading ...
fetch.py Loading ...
gpg.py Loading ...
graphlog.py Loading ...
hgcia.py Loading ...
hgk.py Loading ...
interhg.py Loading ...
keyword.py Loading ...
mq.py Loading ...
notify.py Loading ...
pager.py Loading ...
parentrevspec.py Loading ...
patchbomb.py Loading ...
purge.py Loading ...
rebase.py Loading ...
record.py Loading ...
transplant.py Loading ...
win32mbcs.py Loading ...
win32text.py Loading ...