Message170767
That might work.
To avoid the overhead of the cache lookup I was thinking about something like
regex = None
def _has_surrogates(s):
global regex
if regex is None:
regex = re.compile(short_regex)
return regex.search(s)
but I have discarded it because it's not very pretty and still has the overhead of the function and an additional if. Your version solves both the problems in a more elegant way. |
|
Date |
User |
Action |
Args |
2012-09-19 20:25:35 | ezio.melotti | set | recipients:
+ ezio.melotti, loewis, barry, orsenthil, nadeem.vawda, r.david.murray, rosslagerwall, serhiy.storchaka |
2012-09-19 20:25:35 | ezio.melotti | set | messageid: <1348086335.45.0.638704605617.issue11454@psf.upfronthosting.co.za> |
2012-09-19 20:25:34 | ezio.melotti | link | issue11454 messages |
2012-09-19 20:25:34 | ezio.melotti | create | |
|