Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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. :)


Sorry, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: