python: Add an idiomatic interface.