diff options
author | Paul McGuire <ptmcg@austin.rr.com> | 2016-02-06 20:04:48 +0000 |
---|---|---|
committer | Paul McGuire <ptmcg@austin.rr.com> | 2016-02-06 20:04:48 +0000 |
commit | c5e291530d36611c373b2f7c4c3383eff336a028 (patch) | |
tree | 298bd4c1f17ee2b9949090f3d50cb88e57ec8e87 /src/pyparsing.py | |
parent | f10a0b883d90ecfd86a645f0d568beb4dda54f83 (diff) | |
download | pyparsing-git-c5e291530d36611c373b2f7c4c3383eff336a028.tar.gz |
Add support for pickling ParseResults with protocols 2 and higher (default protocol in Py3 is 3)
Diffstat (limited to 'src/pyparsing.py')
-rw-r--r-- | src/pyparsing.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py index f1f19c8..eaa99b3 100644 --- a/src/pyparsing.py +++ b/src/pyparsing.py @@ -58,7 +58,7 @@ The pyparsing module handles some of the problems that are typically vexing when """
__version__ = "2.0.8"
-__versionTime__ = "23 Jan 2016 01:33"
+__versionTime__ = "6 Feb 2016 13:47"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"
import string
@@ -282,6 +282,8 @@ class ParseResults(object): self.__name = None
self.__parent = None
self.__accumNames = {}
+ self.__asList = asList
+ self.__modal = modal
if isinstance(toklist, list):
self.__toklist = toklist[:]
elif isinstance(toklist, _generatorType):
@@ -688,6 +690,9 @@ class ParseResults(object): else:
self.__parent = None
+ def __getnewargs__(self):
+ return self.__toklist, self.__name, self.__asList, self.__modal
+
def __dir__(self):
return (dir(type(self)) + list(self.keys()))
|