I found interesting short article about integer comparison in python: http://distilledb.com/blog/archives/date/2009/06/18/python-gotcha-integer-equality.page