In [19]:
from rdkit import Chem
In [20]:
m = Chem.EditableMol(Chem.Mol())

Add three hydrogen atoms to the molecule.

In [21]:
h1 = Chem.Atom(1)
h2 = Chem.Atom(1)
h3 = Chem.Atom(1)

m.AddAtom(h1)
m.AddAtom(h2)
m.AddAtom(h3)
Out[21]:
2

Connect the hydrogens into a chain.

In [22]:
m.AddBond(0, 1, Chem.BondType.SINGLE)
m.AddBond(1, 2, Chem.BondType.SINGLE)
Out[22]:
2

No valence errors. They must be caught explicitly.

In [23]:
Chem.DetectChemistryProblems(m.GetMol())
RDKit ERROR: [07:04:24] Explicit valence for atom # 1 H, 2, is greater than permitted
Out[23]:
(<rdkit.Chem.rdchem._cppAtomValenceException at 0x10c35c390>,)