Terry J. Reedy added the comment: Enhancements are only possible in 3.5 or beyond. I agree with Mark. There is no compelling reason to break code with this change. Hence it should be rejected.
Float is an odd duck. All ints and all non-recursive lists, for instance, have a literal representation, and repr used that. No range objects, for instance, have a literal representation, so repr uses a evaluable 'range(start, stop[, step])' All float objects except 3 have a literal representation. Int and float are both unusual builtins in parsing a string input to produce a non-string object. For int, eval(repr(i)) == int(repr(i)) == i for all ints i. Similarly, eval(repr(f)) == float(repr(f)) == f for all float objects f *except* for the same 3 special objects. For those 3, a choice was make and we should stick with it. ---------- nosy: +terry.reedy resolution: -> rejected stage: -> resolved status: open -> closed versions: +Python 3.5 -Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22951> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com