##// 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

File last commit:

r1360:7d439981 default
r8527:f9a80054 default
Show More
__init__.py
1 line | 14 B | text/x-python | PythonLexer
# placeholder