title: how to ignore the order of elements in a tuple
body: <p>I am using tuples as the key for a dictionary I created. For example:</p>
  
  <pre><code>example_dict = {}
  example_dict[("A", "B")] = "1"
  </code></pre>
  
  <p>Later when I wish to modify the value of an entry in the dictionary I don't currently have control over the order of the tuple. For example:</p>
  
  <pre><code>("B", "A") may be the case, instead of ("A", "B")
  </code></pre>
  
  <p>I'm aware that these tuples are not equal from a simple == comparison that I tried in the python shell.</p>
  
  <p>What I am wondering is how I could work around this? How could I make the following not produce a KeyError:</p>
  
  <pre><code>print (example_dict["B", "A"])
  </code></pre>
  
  <p>Is there a way to consistently order the elements of a tuple? Is there a way to ignore order completely? Any other work arounds? I'm aware I could just include all arrangements of the tuples as keys in the dictionary, and then collate the values of the different permutations later. I strongly want to avoid doing this as that only adds difficulty and complexity to the problem.</p>