Skip to content

Commit

Permalink
Blackening (updated black)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptmcg committed Feb 25, 2024
1 parent 26e2180 commit e13a03b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
11 changes: 5 additions & 6 deletions pyparsing/core.py
Expand Up @@ -946,11 +946,9 @@ class to help type checking

not_in_cache: bool

def get(self, *args):
...
def get(self, *args): ...

def set(self, *args):
...
def set(self, *args): ...

# argument cache for optimizing repeated calls when backtracking through recursive expressions
packrat_cache = (
Expand Down Expand Up @@ -3168,6 +3166,7 @@ class QuotedString(Token):
[['This is the "quote"']]
[['This is the quote with "embedded" quotes']]
"""

ws_map = dict(((r"\t", "\t"), (r"\n", "\n"), (r"\f", "\f"), (r"\r", "\r")))

def __init__(
Expand Down Expand Up @@ -5950,8 +5949,8 @@ def srange(s: str) -> str:
- any combination of the above (``'aeiouy'``,
``'a-zA-Z0-9_$'``, etc.)
"""
_expanded = (
lambda p: p
_expanded = lambda p: (
p
if not isinstance(p, ParseResults)
else "".join(chr(c) for c in range(ord(p[0]), ord(p[1]) + 1))
)
Expand Down
18 changes: 9 additions & 9 deletions pyparsing/testing.py
Expand Up @@ -51,23 +51,23 @@ def save(self):
self._save_context["default_whitespace"] = ParserElement.DEFAULT_WHITE_CHARS
self._save_context["default_keyword_chars"] = Keyword.DEFAULT_KEYWORD_CHARS

self._save_context[
"literal_string_class"
] = ParserElement._literalStringClass
self._save_context["literal_string_class"] = (
ParserElement._literalStringClass
)

self._save_context["verbose_stacktrace"] = ParserElement.verbose_stacktrace

self._save_context["packrat_enabled"] = ParserElement._packratEnabled
if ParserElement._packratEnabled:
self._save_context[
"packrat_cache_size"
] = ParserElement.packrat_cache.size
self._save_context["packrat_cache_size"] = (
ParserElement.packrat_cache.size
)
else:
self._save_context["packrat_cache_size"] = None
self._save_context["packrat_parse"] = ParserElement._parse
self._save_context[
"recursion_enabled"
] = ParserElement._left_recursion_enabled
self._save_context["recursion_enabled"] = (
ParserElement._left_recursion_enabled
)

self._save_context["__diag__"] = {
name: getattr(__diag__, name) for name in __diag__._all_names
Expand Down

0 comments on commit e13a03b

Please sign in to comment.