Commit Graph

53 Commits

Author SHA1 Message Date
Thomas Arendsen Hein
16ae1c2ebb coding style: fix yield used as a function 2010-12-03 12:22:56 +01:00
Adrian Buehlmann
5e2e71ea82 check-code: catch Python 'is' comparing number or string literals
The Python 'is' operator compares object identity, so it should
definitely not be applied to string or number literals, which Python
implementations are free to represent with a temporary object.

This should catch the following kinds of bogus expressions (examples):

  x is 'foo'     x is not 'foo'
  x is "bar"     x is not "bar"
  x is 42        x is not 42
  x is -36       x is not -36

As originally proposed by Martin Geisler, amended with catching
negative numbers.
2010-11-21 11:52:27 +01:00
Brodie Rao
dfaf44c2e4 tests: unify test-check-code 2010-10-08 16:08:46 -05:00