Pickle problem

Harvey Thomas hst at empolis.co.uk
Tue Sep 10 06:13:47 EDT 2002

I'm trying to pickle a complicated data structure which includes a dictionary whose entries are created by (simplified):

a[x] = re.compile(y).match

The pickle fails, however, with the error:

PicklingError: Can't pickle <built-in method match of _sre.SRE_Pattern object at
 0x00838700>: it's not found as __main__.match

I'd be grateful if someone could tell me if it is possible to pickle the data structure and what I'm doing wrongly.



This message has been checked for all known viruses by the MessageLabs Virus Scanning Service.

More information about the Python-list mailing list