This is fairly dangerous given the unfortunate amount of overloading we do of the "pulp" module.  Perhaps something in pulp.common would be better.