Port of pytrie to python3