Is the function "next" a good practice to find first occurrence in a iterable?
Is the function "next" a good practice to find first occurrence in a iterable? Question: I’ve learned about iterators and such and discovered this quite interesting way of getting the first element in a list that a condition is applied (and also with default value in case we don’t find it): first_occurence = next((x for …