Is it possible to parse lists in a yaml file directly into a python set by default ? If the answer is yes, how can I achieve this?
E.g.:
import yaml
from yaml.loader import SafeLoader
# Open the file and load the file
with open('Userdetails.yaml') as f:
data = yaml.load(f, Loader=SafeLoader)
print(data)
Expected Output:
{'User': {'user1', 'user2'}}
Instead of:
{'User': ['user1', 'user2']}
And without looping through the dictionary after load.