A proposed alternative api that feels a tad more pythonic to me.

For your consideration.