Ezio Melotti added the comment: > What about _has_surrogates = re.compile('[^\udc80-\udcff]*\Z').match ?
The runtime is a bit slower than re.compile('[\udc80-\udcff]').search, but otherwise it's faster than all the other alternatives. I haven't checked the startup-time, but I suspect it won't be better -- maybe even worse. ---------- Added file: http://bugs.python.org/file27223/issue11454_surr1.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11454> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com