0

I have the following code snippet in code I'm trying to run:

digits = 4 if isinstance(src, unicode) else 2

I get an error, because unicode is unrecognized. I've searched Google for a unicode class in Python, but without luck. How do I import or locate unicode such that this code snippet makes sense ? src is a bytes object, i.e. a sequence of bytes, and the purpose is to detect whether it contains ASCII or Unicode characters.

Shuzheng
  • 11,288
  • 20
  • 88
  • 186

0 Answers0