3 ms·
No comments yet about why in Python 3 the map behavior changed when the iterables are of different lengths? That seems like a gratuitous change. How is that bet
by PhantomGremlin 11y ago
No comments yet about why in Python 3 the map behavior changed when the iterables are of different lengths? That seems like a gratuitous change. How is that better (not just different) than what Python 2 did?
Also, there was one other change in Python 3 that should have been left alone. I'm stealing the meme from a previous poster on HN:
Python 3 broke "Hello, World!"
Why? Why couldn't that "wart" have been left the way it was?
Sometimes it's smarter to not change something, especially if that change breaks nearly 100% of existing programs.
- _callcc 11y agoIIRC the change is related to the change in `iter` which in python2 returns `None` after exhausting a list but in python3 will raise `StopIteration`. Very annoying TBH. I had some really nice list chunking functions using `map` on python2 that no longer work on python3.