use the new python enum instead of hand-rolled version

Addresses one of the points in #621