56
56
:class:`'|'<MatchFirst>`, :class:`'^'<Or>` and :class:`'&'<Each>` operators.
57
57
58
58
The :class:`ParseResults` object returned from
59
- :class:`ParserElement.parseString ` can be
59
+ :class:`ParserElement.parse_string ` can be
60
60
accessed as a nested list, a dictionary, or an object with named
61
61
attributes.
62
62
85
85
and :class:`'&'<Each>` operators to combine simple expressions into
86
86
more complex ones
87
87
- associate names with your parsed results using
88
- :class:`ParserElement.setResultsName `
88
+ :class:`ParserElement.set_results_name `
89
89
- access the parsed data, which is returned as a :class:`ParseResults`
90
90
object
91
- - find some helpful expression short-cuts like :class:`delimitedList `
92
- and :class:`oneOf `
91
+ - find some helpful expression short-cuts like :class:`DelimitedList `
92
+ and :class:`one_of `
93
93
- find more useful common expressions in the :class:`pyparsing_common`
94
94
namespace class
95
95
"""
@@ -106,30 +106,22 @@ class version_info(NamedTuple):
106
106
@property
107
107
def __version__ (self ):
108
108
return (
109
- "{}.{ }.{}" . format ( self .major , self . minor , self .micro )
109
+ f" { self . major } .{ self .minor } . { self .micro } "
110
110
+ (
111
- "{}{}{}" .format (
112
- "r" if self .releaselevel [0 ] == "c" else "" ,
113
- self .releaselevel [0 ],
114
- self .serial ,
115
- ),
111
+ f"{ 'r' if self .releaselevel [0 ] == 'c' else '' } { self .releaselevel [0 ]} { self .serial } " ,
116
112
"" ,
117
113
)[self .releaselevel == "final" ]
118
114
)
119
115
120
116
def __str__ (self ):
121
- return "{ } {} / {}" . format ( __name__ , self . __version__ , __version_time__ )
117
+ return f" { __name__ } { self . __version__ } / { __version_time__ } "
122
118
123
119
def __repr__ (self ):
124
- return "{}.{}({})" .format (
125
- __name__ ,
126
- type (self ).__name__ ,
127
- ", " .join ("{}={!r}" .format (* nv ) for nv in zip (self ._fields , self )),
128
- )
120
+ return f"{ __name__ } .{ type (self ).__name__ } ({ ', ' .join ('{}={!r}' .format (* nv ) for nv in zip (self ._fields , self ))} )"
129
121
130
122
131
- __version_info__ = version_info (3 , 0 , 9 , "final" , 0 )
132
- __version_time__ = "05 May 2022 07:02 UTC"
123
+ __version_info__ = version_info (3 , 1 , 0 , "final" , 1 )
124
+ __version_time__ = "18 Jun 2023 14:05 UTC"
133
125
__version__ = __version_info__ .__version__
134
126
__versionTime__ = __version_time__
135
127
__author__ = "Paul McGuire <[email protected] >"
@@ -139,9 +131,9 @@ def __repr__(self):
139
131
from .actions import *
140
132
from .core import __diag__ , __compat__
141
133
from .results import *
142
- from .core import *
134
+ from .core import * # type: ignore[misc, assignment]
143
135
from .core import _builtin_exprs as core_builtin_exprs
144
- from .helpers import *
136
+ from .helpers import * # type: ignore[misc, assignment]
145
137
from .helpers import _builtin_exprs as helper_builtin_exprs
146
138
147
139
from .unicode import unicode_set , UnicodeRangeList , pyparsing_unicode as unicode
@@ -153,11 +145,11 @@ def __repr__(self):
153
145
154
146
# define backward compat synonyms
155
147
if "pyparsing_unicode" not in globals ():
156
- pyparsing_unicode = unicode
148
+ pyparsing_unicode = unicode # type: ignore[misc]
157
149
if "pyparsing_common" not in globals ():
158
- pyparsing_common = common
150
+ pyparsing_common = common # type: ignore[misc]
159
151
if "pyparsing_test" not in globals ():
160
- pyparsing_test = testing
152
+ pyparsing_test = testing # type: ignore[misc]
161
153
162
154
core_builtin_exprs += common_builtin_exprs + helper_builtin_exprs
163
155
@@ -174,7 +166,9 @@ def __repr__(self):
174
166
"CaselessKeyword" ,
175
167
"CaselessLiteral" ,
176
168
"CharsNotIn" ,
169
+ "CloseMatch" ,
177
170
"Combine" ,
171
+ "DelimitedList" ,
178
172
"Dict" ,
179
173
"Each" ,
180
174
"Empty" ,
@@ -227,9 +221,11 @@ def __repr__(self):
227
221
"alphas8bit" ,
228
222
"any_close_tag" ,
229
223
"any_open_tag" ,
224
+ "autoname_elements" ,
230
225
"c_style_comment" ,
231
226
"col" ,
232
227
"common_html_entity" ,
228
+ "condition_as_parse_action" ,
233
229
"counted_array" ,
234
230
"cpp_style_comment" ,
235
231
"dbl_quoted_string" ,
@@ -241,6 +237,7 @@ def __repr__(self):
241
237
"html_comment" ,
242
238
"identchars" ,
243
239
"identbodychars" ,
240
+ "infix_notation" ,
244
241
"java_style_comment" ,
245
242
"line" ,
246
243
"line_end" ,
@@ -255,8 +252,12 @@ def __repr__(self):
255
252
"null_debug_action" ,
256
253
"nums" ,
257
254
"one_of" ,
255
+ "original_text_for" ,
258
256
"printables" ,
259
257
"punc8bit" ,
258
+ "pyparsing_common" ,
259
+ "pyparsing_test" ,
260
+ "pyparsing_unicode" ,
260
261
"python_style_comment" ,
261
262
"quoted_string" ,
262
263
"remove_quotes" ,
@@ -267,38 +268,33 @@ def __repr__(self):
267
268
"srange" ,
268
269
"string_end" ,
269
270
"string_start" ,
271
+ "token_map" ,
270
272
"trace_parse_action" ,
273
+ "ungroup" ,
274
+ "unicode_set" ,
271
275
"unicode_string" ,
272
276
"with_attribute" ,
273
- "indentedBlock" ,
274
- "original_text_for" ,
275
- "ungroup" ,
276
- "infix_notation" ,
277
- "locatedExpr" ,
278
277
"with_class" ,
279
- "CloseMatch" ,
280
- "token_map" ,
281
- "pyparsing_common" ,
282
- "pyparsing_unicode" ,
283
- "unicode_set" ,
284
- "condition_as_parse_action" ,
285
- "pyparsing_test" ,
286
278
# pre-PEP8 compatibility names
287
279
"__versionTime__" ,
288
280
"anyCloseTag" ,
289
281
"anyOpenTag" ,
290
282
"cStyleComment" ,
291
283
"commonHTMLEntity" ,
284
+ "conditionAsParseAction" ,
292
285
"countedArray" ,
293
286
"cppStyleComment" ,
294
287
"dblQuotedString" ,
295
288
"dblSlashComment" ,
296
289
"delimitedList" ,
297
290
"dictOf" ,
298
291
"htmlComment" ,
292
+ "indentedBlock" ,
293
+ "infixNotation" ,
299
294
"javaStyleComment" ,
300
295
"lineEnd" ,
301
296
"lineStart" ,
297
+ "locatedExpr" ,
302
298
"makeHTMLTags" ,
303
299
"makeXMLTags" ,
304
300
"matchOnlyAtCol" ,
@@ -308,6 +304,7 @@ def __repr__(self):
308
304
"nullDebugAction" ,
309
305
"oneOf" ,
310
306
"opAssoc" ,
307
+ "originalTextFor" ,
311
308
"pythonStyleComment" ,
312
309
"quotedString" ,
313
310
"removeQuotes" ,
@@ -317,15 +314,9 @@ def __repr__(self):
317
314
"sglQuotedString" ,
318
315
"stringEnd" ,
319
316
"stringStart" ,
317
+ "tokenMap" ,
320
318
"traceParseAction" ,
321
319
"unicodeString" ,
322
320
"withAttribute" ,
323
- "indentedBlock" ,
324
- "originalTextFor" ,
325
- "infixNotation" ,
326
- "locatedExpr" ,
327
321
"withClass" ,
328
- "tokenMap" ,
329
- "conditionAsParseAction" ,
330
- "autoname_elements" ,
331
322
]
0 commit comments