diff options
author | ptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b> | 2007-12-10 03:40:41 +0000 |
---|---|---|
committer | ptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b> | 2007-12-10 03:40:41 +0000 |
commit | 800dc88d083455e1430ef343a1e09f5b08c7b78a (patch) | |
tree | 8b1c4ee198b8a6a9b431d4c3ec364177e1f8ac58 | |
parent | 3f8e71b79365f706844e035ecabe28961485dc11 (diff) | |
download | pyparsing-800dc88d083455e1430ef343a1e09f5b08c7b78a.tar.gz |
Add __rmul__ to make __mul__ commutative.
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/src@133 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
-rw-r--r-- | pyparsing.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pyparsing.py b/pyparsing.py index 244829a..747c0d0 100644 --- a/pyparsing.py +++ b/pyparsing.py @@ -1089,6 +1089,9 @@ class ParserElement(object): ret = And([self]*minElements)
return ret
+ def __rmul__(self, other):
+ return self.__mul__(other)
+
def __or__(self, other ):
"""Implementation of | operator - returns MatchFirst"""
if isinstance( other, basestring ):
|