Let's assume I read the following strings out of a file:
s1 = "{'XXX-YYY'}"
s2 = "{'XXX-YYY', 'XXX-ZZZ', 'XXX-AAA', 'XXX-BBB'}"
I want convert both strings to valid sets. I tried this:
s1 = {s1}
s2 = set((s2, ))
The outcome is obviously not a valid set():
{"{'XXX-YYY'}"}
{"{'XXX-YYY', 'XXX-ZZZ', 'XXX-AAA', 'XXX-BBB'}"}
It should be:
{'XXX-YYY'}
{'XXX-YYY', 'XXX-ZZZ', 'XXX-AAA', 'XXX-BBB'}
How can I achieve this?