def string_contains_surrogates(ustring):
 for c in map(ord, ustring):
  if (c > 65535):
   return True
  if (55296 <= c <= 57343):
   return True
 return False

def string_contains_surrogates ( ustring ) : for c in map ( ord , ustring ) : if ( c > 65535 ) : return True if ( 55296 <= c <= 57343 ) : return True return False
check if the unicode string contains surrogate code points on a cpython platform with wide or narrow unicode .