["python","list"]
How can I verify if one list is a subset of another?

I need to verify if a list is a subset of another - a boolean return is all I seek. Is testing equality on the smaller list after an intersection the fastest way to do this? Performance is of utmost importance given the number of datasets that need to be compared. Adding further facts based on discussions: Will either of the lists be the same for many tests? It does as one of them is a static lookup table. Does it need to be a list? It does not - the static lookup table can be anything that performs best. The dynamic one is a dict from which we extract the keys to perform a static lookup on. What would be the optimal solution given the scenario?
Use set.issubset Example: a = {1,2} b = {1,2,3} a.issubset(b) # True a = {1,2,4} b = {1,2,3} a.issubset(b) # False The performant function Python provides for this is set.issubset. It does have a few restrictions that make it unclear if it's the answer to your question, however. A list may contain items multiple times and has a specific order. A set does not. Additionally, sets only work on hashable objects. Are you asking about subset or subsequence (which means you'll want a string search algorithm)? Will either of the lists be the same for many tests? What are the datatypes contained in the list? And for that matter, does it need to be a list? Your other post intersect a dict and list made the types clearer and did get a recommendation to use dictionary key views for their set-like functionality. In that case it was known to work because dictionary keys behave like a set (so much so that before we had sets in Python we used dictionaries). One wonders how the issue got less specific in three hours.