from rdkit import Chem
m = Chem.EditableMol(Chem.Mol())
Add three hydrogen atoms to the molecule.
h1 = Chem.Atom(1)
h2 = Chem.Atom(1)
h3 = Chem.Atom(1)
m.AddAtom(h1)
m.AddAtom(h2)
m.AddAtom(h3)
Connect the hydrogens into a chain.
m.AddBond(0, 1, Chem.BondType.SINGLE)
m.AddBond(1, 2, Chem.BondType.SINGLE)
No valence errors. They must be caught explicitly.
Chem.DetectChemistryProblems(m.GetMol())