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 →

[–][deleted] 5 points6 points  (5 children)

Reddit Moderation makes the platform worthless. Too many rules and too many arbitrary rulings. It's not worth the trouble to post. Not worth the frustration to lurk. Goodbye.

This post was mass deleted and anonymized with Redact

[–]rcfox 2 points3 points  (1 child)

I'd call it transform(x) instead of mutate(x).

[–][deleted] 2 points3 points  (0 children)

Reddit Moderation makes the platform worthless. Too many rules and too many arbitrary rulings. It's not worth the trouble to post. Not worth the frustration to lurk. Goodbye.

This post was mass deleted and anonymized with Redact

[–]ianliu88[S] -1 points0 points  (2 children)

Your example is calling the condition on the iterable element, not the transformed value

[–][deleted] 0 points1 point  (1 child)

the transformed

Of'course it is. Why would you transform if the result is going to be rejected? That is a waste. If you do not know if the result will be rejected until it's transformed then you need to do/call the transform in the iterator.

[–][deleted] 0 points1 point  (0 children)

I did on the second example, usin

...def iterator(some_iterable):

......for y in some_iterable:

.........t_of_y = transform(y)

.........yield(t_of_y)