Quote:
Originally Posted by JimmXinu
All I know is that code that worked in Py2 failed in spectacularly obscure ways when I was making the FFF CLI run in Py3.
|
I think it is probably fair to say many developers of python applications thought the same.
Quote:
Originally Posted by JimmXinu
From what I understand (which I admit is very shallow), they were the 'pythonic' solutions before list comprehension came along to avoid writing loops and were extremely common. In my ignorance, I copied them from older code which probably copied from even older code.
Okay, I may be arguing the point a bit after all... 
|
List comprehensions, as well as generator expressions which are the predictable way to get a lighter-memory iterator when you actually want an iterator.
It is probably worth noting that python-modernize will happily convert filter()/map() to list/generator expressions.

Can't be too wrong to do the same yourself...