Comment

Comment by alexfrydl

Ruby's “for … in” is syntax sugar in the sense that is just another way to spell an identical piece of code. This would be like if Python let you write “foreach” instead of “for” if you wanted to. Another example in Ruby is how you can say “unless” instead of “if not”.

Python's “for … in” is syntax sugar in the sense that is an abstraction over constantly writing out the iterator protocol.

parent alexfrydl 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton