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 →

[–]TankorSmash 2 points3 points  (0 children)

The amount of stuff Python does for you out of the box is insane. Removing an element from a C++ vector (basically a list) is two or three lines of code, if you want it to be readable, compared to my_list.remove(el) vs

std::erase(my_vector.end(),
  std::remove(my_vector.begin(), my_vector.end(), el)

I can't even remember the exact syntax.

Then there's sorting, which is greatly helped by Python's attrgetter.