summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2015-12-13 19:15:06 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2015-12-13 19:15:06 +0000
commit7855d2ca9c3f3c323c73f7ba958fd54863ba8cb8 (patch)
tree2ed06463e4d76b192fda53bc9835b15c556dd9da
parentef0f9e58a34b88ea3e7cb4207af327cfaa13af9b (diff)
downloadpyparsing-7855d2ca9c3f3c323c73f7ba958fd54863ba8cb8.tar.gz
Fixed up implementations of __dir__ to reduce maintenance overhead, and fix output of ParseResults instance dirs.
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@305 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
-rw-r--r--src/CHANGES3
-rw-r--r--src/pyparsing.py7
2 files changed, 6 insertions, 4 deletions
diff --git a/src/CHANGES b/src/CHANGES
index ce95f13..fbae5d7 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -13,6 +13,9 @@ Version 2.0.7 -
Or and MatchFirst, handling Unicode values in expressions. Fixes Unicode
encoding issues in Python 2, thanks to Evan Hubinger for the bug report.
+- Fixed implementation of dir() for ParseResults - was leaving out all the
+ defined methods and just adding the custom results names.
+
Version 2.0.6 -
---------------------------
diff --git a/src/pyparsing.py b/src/pyparsing.py
index 3366b8a..9d697dd 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.7"
-__versionTime__ = "25 Nov 2015 09:02"
+__versionTime__ = "13 Dec 2015 13:09"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"
import string
@@ -205,8 +205,7 @@ class ParseBaseException(Exception):
markerString, line_str[line_column:]))
return line_str.strip()
def __dir__(self):
- return "loc msg pstr parserElement lineno col line " \
- "markInputline __str__ __repr__".split()
+ return "lineno col line".split() + dir(type(self))
class ParseException(ParseBaseException):
"""exception thrown when parse expressions don't match class;
@@ -684,7 +683,7 @@ class ParseResults(object):
self.__parent = None
def __dir__(self):
- return dir(super(ParseResults,self)) + list(self.keys())
+ return (dir(type(self)) + list(self.keys()))
collections.MutableMapping.register(ParseResults)