Originally reported by: Claude Paroz (Bitbucket: claudep, GitHub: claudep)
Hi,
We're planning to embed six in Django as the blessed Python 3 compatibility layer. One thing we're missing is a function that returns a byte string on Python 2 and Unicode in Python 3. This is typically useful when providing arguments for strftime() or type(). Our current implementation is: * Python 2: n = lambda n: n.encode('utf-8') * Python 3 (noop): n = lambda n: n
We could of course provide it in some of our own modules, but it would be nice to have it in six, unless you suggest a better replacement.
- Bitbucket: https://bitbucket.org/gutworth/six/issue/12
该提问来源于开源项目:benjaminp/six