title: RDKit: how to check molecules for exact match?
body: <p>I'm using RDKit and trying to check molecules for exact match.
  After using <code>Chem.MolFromSmiles()</code> the expression <code>m == p</code> apparently doesn't lead to the desired result.
  Of course, I can check whether <code>p</code> is a substructure of <code>m</code> and whether <code>m</code> is a substructure of <code>p</code>. But to me this looks too complicated. I couldn't find or overlooked a code example for exact match in the RDKit-documentation. How do I do this correctly? Thank you for hints.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>from rdkit import Chem
  
  myPattern = 'c1ccc2c(c1)c3ccccc3[nH]2'          # Carbazole
  myMolecule = 'C1=CC=C2C(=C1)C3=CC=CC=C3N2'      # Carbazole
  
  m = Chem.MolFromSmiles(myMolecule)
  p = Chem.MolFromSmiles(myPattern)
  
  print(m == p)                    # returns False, first (unsuccessful) attempt to check for identity
  
  print(m.HasSubstructMatch(p))    # returns True
  print(p.HasSubstructMatch(m))    # returns True
  print(m.HasSubstructMatch(p) and p.HasSubstructMatch(m))    # returns True, so are the molecules identical?
  </code></pre>