python3 compatibility: range, zip, StringIO