Hacker News new | ask | show | jobs
by eesmith 3224 days ago
What is a 2to3 tool supposed to do here?

python2 prints "set([0, 1])" while python3 prints "{0,1}".

Is it supposed to normalize the str() so it matches Python2?

For that matter, the str() for floats has changed:

  % python
  Python 2.7.10 (default, Jul 30 2016, 19:40:32)
  [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  >>> print(-1.0000000000000002)
  -1.0
  >>>
  % python3
  Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13)
  [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  >>> print(-1.0000000000000002)
  -1.0000000000000002