View Single Post
Old 05-14-2019, 09:56 PM   #3433
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by JimmXinu View Post
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 View Post
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...

Last edited by eschwartz; 05-14-2019 at 10:00 PM.
eschwartz is offline   Reply With Quote