Determine if variable is str in python2.7 or bytes in python3

后端 未结 0 1090
暗喜
暗喜 2021-02-04 15:39

I have a piece of code that I want to be compatible with both Python2.7 and Python3.

For Python 2.7 - I want to do - if isinstance(content, str).

For

相关标签:
回答
  • 消灭零回复
提交回复
热议问题