[Python-ideas] Add regex pattern literal p""

Ma Lin malincns at 163.com
Thu Dec 27 08:15:10 EST 2018


 > It'd be good to know just how much benefit this precompilation 
actually grants.

As far as I know, Pattern objects in regex module can be pickled, don't 
know if it's useful.

 >>> import pickle
 >>> import regex
 >>> p = regex.compile('[a-z]')
 >>> b = pickle.dumps(p)
 >>> p = pickle.loads(b)

 > Wow that's an old post of mine
I searched on Google before post this, hope there is no omission.



More information about the Python-ideas mailing list