There&#x27;s some discussion here: <a href="https:&#x2F;&#x2F;docs.python.org&#x2F;3.1&#x2F;tutorial&#x2F;floatingpoint.html" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;3.1&#x2F;tutorial&#x2F;floatingpoint.html</a>. Basically: eval(repr(x)) == x is guaranteed, and some attempt is made to give the shortest such string representation for Python 3.1+ (and 2.7?), but it&#x27;s not guaranteed on all platforms.