This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SRE: pickling support
Type: Stage:
Components: None Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: effbot Nosy List: akuchling, effbot, gvanrossum
Priority: normal Keywords: patch

Created on 2000-06-27 19:39 by effbot, last changed 2022-04-10 16:02 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
None effbot, 2000-06-27 19:39 None
Messages (7)
msg32871 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2000-06-27 19:39
 
msg32872 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2000-06-27 20:22
I don't think this should go in in this form.  What he says; plus: why should we support pickling compiled regular expressions when the uncompiled form is so much more portable?

There's maybe another way: sre can import copy_reg and make the registration request.
msg32873 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2000-06-28 22:27
Rejected at the request of the author.
(Not deleted because the discussion is still valuable.)
msg32874 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2000-06-27 20:45
Agreed, pickling of REs seems of marginal importance.
I'd have no problem with just dropping the ability, and seeing if anyone complains.  
msg32875 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2000-06-27 19:42
I'm not entirely happy about having to import SRE
everytime someone wants to use pickle, but I cannot
come up with a better way to do this.

maybe we should drop pickle support?  we don't support
pickling of other code objects, after all...
msg32876 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2000-06-27 21:17
my original comment was a bit unclear; the code pickles the source pattern (and the flags), and it recompiles the pattern when the pickle is unpacked.

but I think Andrew is right; let's drop this for now, and see if anyone misses it.

now, how do I *remove* a patch?
msg32877 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2000-06-30 13:21
Implemented Guido's idea: the 'sre' module installs the pickler when it's first imported.  This means that you have to explicitly import 'sre' before you can unpickle a pattern.
History
Date User Action Args
2022-04-10 16:02:01adminsetgithub: 32468
2000-06-27 19:39:34effbotcreate