Finding x is 1, and x is 'foo' comparisons in a code base

2012-01-17 Thread Alex Willmer
Hello, I'm looking for a way to find the occurrences of x is y comparisons in an existing code base. Except for a few special cases (e.g. x is [not] None) they're a usually mistakes, the correct test being x == y. However they happen to work most of the time on CPython (e.g. when y is a small

Re: Finding x is 1, and x is 'foo' comparisons in a code base

2012-01-17 Thread MRAB
On 17/01/2012 17:10, Alex Willmer wrote: Hello, I'm looking for a way to find the occurrences of x is y comparisons in an existing code base. Except for a few special cases (e.g. x is [not] None) they're a usually mistakes, the correct test being x == y. However they happen to work most of the

Re: Finding x is 1, and x is 'foo' comparisons in a code base

2012-01-17 Thread Thomas Heller
Am 17.01.2012 18:10, schrieb Alex Willmer: Hello, I'm looking for a way to find the occurrences of x is y comparisons in an existing code base. Except for a few special cases (e.g. x is [not] None) they're a usually mistakes, the correct test being x == y. However they happen to work most of