>>11430428>Python should be written in a way someone who didn't learn python would expect things to workI'd say it's a fair stance, but it prevents the language from being it's own thing. I'm against that.
In Python, you'd do
with open(filepath, "r") as in_file:
content = in_file.read()
People coming from C/C++ and other languages inadvertenly do
fp = open(filepath, "r")
content = in_file.read()
fp.close()
And potentially they add a ; at the end of each line, which python will also accept. You're basically want the language to be the non-compiled language that people can quickly use, not the nice thing it actually is.
In Pythin you can do
things = (elem for n, elem in enumerate(my_elems) if selection_criteria(n))
things = map(f, things)
and I get that you might want to break that apart into steps for readability
but avoiding all comprehension and just writing Php alla
things = []
for n in range(len(my_elems)):
if selection_criteria(n):
elem = my_elems[n]
things.append(f(elem))
feels wrong too. In any case, it's not parallelizable as much (in case that matters)