How about simplifying to base units then comparing e.g.,:
import pint u = pint.UnitRegistry() u('nM').to_base_units() == u('nmol/L').to_base_units()