4 ms·
Uh-oh, and well, integer division now gives float $ python3 >>> 1/2 0.5 VS $ python2.7 >>> 1/2 0 which can cause a great load of bug
by alain_gilbert 8y ago
Uh-oh, and well, integer division now gives float
$ python3
>>> 1/2
0.5
VS
$ python2.7
>>> 1/2
0
which can cause a great load of bugs if you're just porting some existing code.
- js2 8y agoTrue, but I can’t recall a single time I wanted the integer division behavior of Python 2.
- aldanor 8y agoAnd strings are now strings, surprisingly, and not bytes...
- js2 8y agoWhy do you say surprisingly? I've been aware of the bytes/string split for a long time since it's probably Python 3's most prominent change, so I certainly wasn't surprised by it. The surprising part for me (after having read complaints about this change over the years) is that I haven't had any trouble with it.
- aldanor 8y agoApologies, it was a (failed) attempt at sarcasm :)