Skip to content

Commit

Permalink
Undo selected replaced_by_pep8 calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ptmcg committed Mar 9, 2024
1 parent f39d8b3 commit fe91e53
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pyparsing/common.py
Expand Up @@ -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
"""
Expand Down
10 changes: 6 additions & 4 deletions pyparsing/results.py
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyparsing/util.py
Expand Up @@ -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):
Expand Down

0 comments on commit fe91e53

Please sign in to comment.