Python Interpreter Bug?

Chris Liechti cliechti at
Sat Aug 24 01:36:19 CEST 2002

Rakis <rakis at> wrote in news:mailman.1030142381.27815.python-
list at
>     if decl[i] is ":" and decl[i-1] is not ":" and decl[i+1] is not ":":

unlikely that this works as you want. note that "is" tests if they are the 
same objects (id(x) == id(y)). this can be true for '":" is ":"' because of 
string inlining, but its not required to be so, and it wont for most cases.

what you want is 'decl[i] == ":"' resp != which compares the content of the 

Chris <cliechti at>

More information about the Python-list mailing list