type('') to str by dnit · Pull Request #4025 · encode/django-rest-framework (original) (raw)

I believe we've just changed the meaning here. string_types includes both binary and unicode. type('') with from __future__ import unicode_literals will always only be unicode.

I think we should probably have if isinstance(auth, text_type), to preserve the meaning, as the intent is to encode unicode into bytestrings.