Is it possible to take an ordered "slice" of a dictionary in Python based on a list of keys?
Suppose I have the following dictionary and list:

    my_dictionary = {1:"hello", 2:"goodbye", 3:"World", "sand":"box"}
    my_list = [1,2,3]

Is there a direct (Pythonic) way to get the key-value pairs out of the dictionary for which the keys are elements in the list, in an order defined by the list order?

The naive approach is simply to iterate over the list and pull out the values in the map one by one, but I wonder if python has the equivalent of list slicing for dictionaries.

Is it possible to take an ordered "slice" of a dictionary in Python based on a list of keys?
===

Suppose I have the following dictionary and list:

    my_dictionary = {1:"hello", 2:"goodbye", 3:"World", "sand":"box"}
    my_list = [1,2,3]

Is there a direct (Pythonic) way to get the key-value pairs out of the dictionary for which the keys are elements in the list, in an order defined by the list order?

The naive approach is simply to iterate over the list and pull out the values in the map one by one, but I wonder if python has the equivalent of list slicing for dictionaries.
