summaryrefslogtreecommitdiff
path: root/pyparsing/helpers.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2022-07-14 03:35:10 -0500
committerptmcg <ptmcg@austin.rr.com>2022-07-14 03:35:10 -0500
commit06c12f685b5d0e29f01abc842dff8d268d93ffbf (patch)
tree720b0faafd07b602965918c88dc981958dba50ee /pyparsing/helpers.py
parentc74949d0cafbe7c136a54777b9b340c37f00b484 (diff)
downloadpyparsing-git-06c12f685b5d0e29f01abc842dff8d268d93ffbf.tar.gz
Add type annotations
Diffstat (limited to 'pyparsing/helpers.py')
-rw-r--r--pyparsing/helpers.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/pyparsing/helpers.py b/pyparsing/helpers.py
index f3e0ab5..c4ac2a9 100644
--- a/pyparsing/helpers.py
+++ b/pyparsing/helpers.py
@@ -294,6 +294,7 @@ def one_of(
symbols: List[str] = []
if isinstance(strs, str_type):
+ strs = typing.cast(str, strs)
symbols = strs.split()
elif isinstance(strs, Iterable):
symbols = list(strs)
@@ -570,6 +571,8 @@ def nested_expr(
raise ValueError("opening and closing strings cannot be the same")
if content is None:
if isinstance(opener, str_type) and isinstance(closer, str_type):
+ opener = typing.cast(str, opener)
+ closer = typing.cast(str, closer)
if len(opener) == 1 and len(closer) == 1:
if ignoreExpr is not None:
content = Combine(