Answer the question
In order to leave comments, you need to log in
Is it advantageous to use a generator instead of a set here?
I have a set of all_members, it stores positive integers. So far there are not many of them, but I want to optimize for more loads from the very beginning. So, is it profitable to convert it into a generator if it is then used only in a loop? They say that generators, if needed only for a cycle, are more productive, but in order for him to generate elements of a set, he needs to store this set somewhere? Tell
all_members = itertools.chain.from_iterable([all_members])
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question