diff --git a/pyparsing/common.py b/pyparsing/common.py index bb43d5d6..649aad00 100644 --- a/pyparsing/common.py +++ b/pyparsing/common.py @@ -151,12 +151,12 @@ class pyparsing_common: [UUID('12345678-1234-5678-1234-567812345678')] """ - convert_to_integer = staticmethod(token_map(int)) + convert_to_integer = token_map(int) """ Parse action for converting parsed integers to Python int """ - convert_to_float = staticmethod(token_map(float)) + convert_to_float = token_map(float) """ Parse action for converting parsed numbers to Python float """ diff --git a/pyparsing/results.py b/pyparsing/results.py index f9864ae0..91741ccb 100644 --- a/pyparsing/results.py +++ b/pyparsing/results.py @@ -788,10 +788,12 @@ def is_iterable(obj): ret = cls([ret], name=name) return ret - # Compatibility synonyms - asList = replaced_by_pep8("asList", as_list) - asDict = replaced_by_pep8("asDict", as_dict) - getName = replaced_by_pep8("getName", get_name) + asList = as_list + """Deprecated - use :class:`as_list`""" + asDict = as_dict + """Deprecated - use :class:`as_dict`""" + getName = get_name + """Deprecated - use :class:`get_name`""" MutableMapping.register(ParseResults) diff --git a/pyparsing/util.py b/pyparsing/util.py index 1da0e8c7..94837fea 100644 --- a/pyparsing/util.py +++ b/pyparsing/util.py @@ -246,7 +246,7 @@ def replaced_by_pep8(compat_name: str, fn: C) -> C: # (Presence of 'self' arg in signature is used by explain_exception() methods, so we take # some extra steps to add it if present in decorated function.) - if "self" == next(iter(inspect.signature(fn).parameters), ""): + if ["self"] == list(inspect.signature(fn).parameters)[:1]: @wraps(fn) def _inner(self, *args, **kwargs):