pyobjects: sync with upstream code