PR: updated Python interface to new API.