##// 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
/ contrib
git-viz
hgsh
macosx
vim
win32
bash_completion Loading ...
buildrpm Loading ...
convert-repo Loading ...
dumprevlog Loading ...
hg-relink Loading ...
hg-ssh Loading ...
hgdiff Loading ...
hgk Loading ...
hgwebdir.fcgi Loading ...
hgwebdir.wsgi Loading ...
logo-droplets.svg Loading ...
mercurial.el Loading ...
mercurial.spec Loading ...
mergetools.hgrc Loading ...
mq.el Loading ...
perf.py Loading ...
python-hook-examples.py Loading ...
rewrite-log Loading ...
sample.hgrc Loading ...
simplemerge Loading ...
tcsh_completion Loading ...
tcsh_completion_build.sh Loading ...
tmplrewrite.py Loading ...
undumprevlog Loading ...
zsh_completion Loading ...