[issue11454] email.message import time

Serhiy Storchaka report at bugs.python.org
Wed Sep 19 23:26:28 CEST 2012


Serhiy Storchaka added the comment:

def _has_surrogates(s):
    try:
        s.encode()
        return False
    except UnicodeEncodeError:
        return True

Results:
0.26 <- re.compile(short_regex).search
0.06 <- try encode

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11454>
_______________________________________


More information about the Python-bugs-list mailing list