This should be compatible with py3 and pypy