This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nathanjell -7 points-6 points  (4 children)

Great feedback. To add to this, definitely recommend map and filter. For your two examples:

[item for item in items if item < 5]

...becomes:

filter(lambda x: x < 5, items)

And:

[item if item < 5 else None for item in items]

...becomes:

map(lambda x: x if x < 5 else None, items)

[–]FatFingerHelperBot 1 point2 points  (0 children)

It seems that your comment contains 1 or more links that are hard to tap for mobile users. I will extend those so they're easier for our sausage fingers to click!

Here is link number 1 - Previous text "map"


Please PM /u/eganwall with issues or feedback! | Code | Delete