PR: update Python interface for new API.