summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-11-02 10:58:21 -0700
committerPaul McGuire <ptmcg@users.noreply.github.com>2019-11-02 12:58:21 -0500
commit6a39aa47c7451584e9fe6c4f4bcd33f522f54d5d (patch)
tree86d461ac57177797001936d31d9f080e66ea203c
parent53d1b4a6f48a53c4c4ec4ac7031362b691c0366d (diff)
downloadpyparsing-git-6a39aa47c7451584e9fe6c4f4bcd33f522f54d5d.tar.gz
Use staticmethod decorator (#158)
Available since Python 2.4. https://docs.python.org/3/library/functions.html#staticmethod
-rw-r--r--tests/test_unit.py29
1 files changed, 8 insertions, 21 deletions
diff --git a/tests/test_unit.py b/tests/test_unit.py
index 495fd0d..4af9bd3 100644
--- a/tests/test_unit.py
+++ b/tests/test_unit.py
@@ -2919,33 +2919,25 @@ class Test2_WithoutPackrat(TestParseResultsAsserts):
return
class CallableS3:
- # ~ @staticmethod
+ @staticmethod
def __call__(s, l, t):
return t
- __call__ = staticmethod(__call__)
-
class CallableS2:
- # ~ @staticmethod
+ @staticmethod
def __call__(l, t):
return t
- __call__ = staticmethod(__call__)
-
class CallableS1:
- # ~ @staticmethod
+ @staticmethod
def __call__(t):
return t
- __call__ = staticmethod(__call__)
-
class CallableS0:
- # ~ @staticmethod
+ @staticmethod
def __call__():
return
- __call__ = staticmethod(__call__)
-
class CallableC3:
# ~ @classmethod
def __call__(cls, s, l, t):
@@ -2975,27 +2967,22 @@ class Test2_WithoutPackrat(TestParseResultsAsserts):
__call__ = classmethod(__call__)
class parseActionHolder:
- # ~ @staticmethod
+ @staticmethod
def pa3(s, l, t):
return t
- pa3 = staticmethod(pa3)
- # ~ @staticmethod
+ @staticmethod
def pa2(l, t):
return t
- pa2 = staticmethod(pa2)
- # ~ @staticmethod
+ @staticmethod
def pa1(t):
return t
- pa1 = staticmethod(pa1)
- # ~ @staticmethod
+ @staticmethod
def pa0():
return
- pa0 = staticmethod(pa0)
-
def paArgs(*args):
print(args)
return args[2]