News for hackers. Stuff that matters.
Re:Examples of Incorrect Abstractions in Other Languages by oh_sigh on Tuesday May 19, 2020 @11:13PM (#23242948)
But in almost all of the langauge, TOOWTDI is not strictly enforced, it is merely a highly encouraged convention. For example, why am I allowed to do

    mylist = [x*2 for x in range(1,10)]
but also do

    mylist = []
    for x in range(1,10):
      mylist.append(x*2)
That's two ways to do the same thing, and I bet you would find a lot of the latter in beginner's python code. I think a better choice would to just have a linter which enforced the correct usage of sum() and join(), and not the implementation itself.
Re:Examples of Incorrect Abstractions in Other Languages by lgas on Wednesday May 20, 2020 @12:08AM (#23243206)
There's probably a lot more than two ways too, eg.

    mylist = map(lambda x: x * 2, range(1, 10))
Re:Examples of Incorrect Abstractions in Other Languages by fractalb on Wednesday May 20, 2020 @02:53AM (#23244022)
map will return an iterator, not a list
Re:Examples of Incorrect Abstractions in Other Languages by kortilla on Wednesday May 20, 2020 @03:44AM (#23244339)
Then call list(map(...

The point stands.

Re:Examples of Incorrect Abstractions in Other Languages by kragen on Wednesday May 20, 2020 @05:21AM (#23244862)
Only in Python 3, not Python 1 or Python 2.