2 ms·
All the examples are things that no longer work in Python 3. Half of them are about functions like range() and .values() becoming lazy instead of returning sim
by duckerude 6y ago
All the examples are things that no longer work in Python 3.
Half of them are about functions like range() and .values() becoming lazy instead of returning simple lists. I think this is a genuine blow to ease of use, though it does get rid of performance pitfalls.
The other half are about / always doing float division. But I think that's actually more intuitive for people who aren't already used to other programming languages, and it's much more predictable given that Python is dynamically typed and floats and ints sometimes get mixed up. It's also not awkward to work around, you can just write // instead of /. (Working around the other issue requires wrapping list() around things, which gets ugly very fast.)