It\'s well known that comparing floats for equality is a little fiddly due to rounding and precision issues.
For example: https://randomascii.wordpress.com/2012/02/2
If you want to use it in testing/TDD context, I'd say this is a standard way:
from nose.tools import assert_almost_equals assert_almost_equals(x, y, places=7) #default is 7