I just tested this: In Python 2, encoding a bytestring will decode it first, and then encode it as specified. In that case, the penalty for providing a bytestring instead of a unicode object just results in a (negligible) performance reduction.

In Python 3 on contrast, calling the `.encode()` method on a bytestring will fail.

I'd keep the statement on line 68 as-is, and add documentation to make it clear that unicode objects are expected. I'll add separate comments there.