Hacker News new | ask | show | jobs
by HerrMonnezza 1847 days ago
The issue is that `int(x) / int(y)` would yield an int result in Python 2, but a float result in Python 3. So you had to find all the spots in your code where `/` was being used as an integer division operator and replace it with `//`.

Since Python 2 does not have any form of type annotation, this made the task hard to do automatically and error-prone.

1 comments

Keep in mind that // was added to python in version 2.2a3 along with `from __future__ import division`. This gave everyone almost 7 years to fix up any existing code before the first release of python 3 even happened. 2.7 only got deprecated in 2020, giving developers a total of 18 years to fix their divisions.

I don't know what the PSF should have done to placate people. Keeping a core feature like division confusing like that isn't a good option, and extending support even longer seems ludicrous to me.