3 ms·
I think you're making a good point, which is that the new python features are usually more "syntactic sugar" than they are "features". It is not very hard to te
by lacker 18y ago
I think you're making a good point, which is that the new python features are usually more "syntactic sugar" than they are "features". It is not very hard to teach people that
alist = [foo(x) for x in things if isok(x)]
is equivalent to
alist = []
for x in things:
if isok(x):
alist.append(foo(x))
Similarly it's not hard to explain what an @login_required or a @memoize decorator does, although it is tricky to write a decorator yourself. Same goes for generators.
I don't think syntactic sugar is a bad thing. I wish C++ had better syntax. If I could never type hash_map<blah, blah>::iterator ever again, I would be happy. But that isn't the sort of feature that C++ tends to add.