3 ms·
Having used Python 3 a bit, there are things I miss in Python 2. Like when I write something quickly and accidentally use integer division (In Py3, 1/2 == 0.5).
by takluyver 14y ago
Having used Python 3 a bit, there are things I miss in Python 2. Like when I write something quickly and accidentally use integer division (In Py3, 1/2 == 0.5).
- lutusp 14y ago> Having used Python 3 a bit, there are things I miss in Python 2. Like when I write something quickly and accidentally use integer division (In Py3, 1/2 == 0.5). That's been addressed -- in Python 3 there are now two kinds of division and two operator symbols: >>> 100 / 9 11.11111111111111 >>> 100 // 9 11 But you have to remember to use the right symbol. :)
- takluyver 14y agoSorry, I should have made that clearer. I know and like the division semantics in Python 3. It's when I go back to Python 2 that I get bitten by 1/2==0. I know that I can use __future__ to sort that out, but when I'm writing something quickly, I often forget that until I work out why my code is misbehaving.