weixin_39942191 2020-11-20 20:36
浏览 0

Could do with some decorators for the __unicode__ and __str__ rename

Originally reported by: Tom Grainger (Bitbucket: graingert, GitHub: graingert)

Django uses https://github.com/django/django/blob/master/django/utils/encoding.py#L26

to support both python2 and python3 style __unicode__ and __str__ renames.

the Python 3 porting guide suggests http://docs.python.org/3/howto/pyporting.html#str-unicode

This pattern is likely to be used in lots of projects hoping to support both 3k and 2, so I think it should be included in six.

  • Bitbucket: https://bitbucket.org/gutworth/six/issue/15

该提问来源于开源项目:benjaminp/six

  • 写回答

7条回答 默认 最新

  • weixin_39942191 2020-11-20 20:36
    关注

    Pull request #48 was merged.

    评论

报告相同问题?