Restore python functionality.

Overzealously deleted in previous commit.