Skip to content
Snippets Groups Projects
  1. May 22, 2009
  2. May 21, 2009
  3. May 20, 2009
  4. May 19, 2009
    • Martin Geisler's avatar
      use 'x is None' instead of 'x == None' · f9a80054
      Martin Geisler authored
      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
      f9a80054
    • Martin Geisler's avatar
      patch: simplify Boolean expression slightly · f78eadbb
      Martin Geisler authored
      The context variable is either True, False or None. Abbreviate it as C
      and we get the following truth table where the second column is the
      original expression and the third column is the new expression:
      
        C     | C or C == None | C is not False
        True  | True           | True
        False | False          | False
        None  | True           | True
      f78eadbb
  5. May 05, 2009
  6. May 04, 2009
  7. May 19, 2009
  8. May 15, 2009
  9. May 14, 2009
  10. May 19, 2009
  11. May 17, 2009
  12. May 19, 2009
  13. May 18, 2009
Loading