View Single Post
Old 05-14-2019, 09:50 PM   #3432
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,003
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by eschwartz View Post
Actually this is not strictly true, they create iterables on py3 and `for i in iterable` works, as does `' '.join(iterable)`. What doesn't work is len(iterable) or iterable[0], and in many, but not all cases, FanFicFare needs to save variables that will later be consumed that way -- but the difference between py2 and py3 is that py2's map() is py3's list(map()).
I'm not going to argue the point. 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.

And rather than worry about the esoteric details about how and why they are different, I decided filter() & map() are simply broken and not to be used in code that needs to run on both Py2 and Py3.

Quote:
Originally Posted by eschwartz View Post
That being said, there are many who would say filter is un-pythonic. It's sort of a bikeshed issue whether to surround everything with list() or replace it with list comprehensions.
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...
JimmXinu is offline   Reply With Quote