You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed bug Bug when defining WordStart with wordChars argument #346, when a string of word characters was passed to WordStart or WordEnd instead of just taking the default value. Originally posted as a question by Parag on StackOverflow, good catch!
Fixed bug in ParserElement.run_tests where comments would be displayed using with_line_numbers.
Added optional "min" and "max" arguments to delimited_list. PR submitted by Marius, thanks!
Added new API change note in whats_new_in_pyparsing_3_0_0, regarding a bug fix in the bool() behavior of ParseResults.
Prior to pyparsing 3.0.x, the ParseResults class implementation of __bool__ would return False if the ParseResults item list was empty, even if it contained named results. In 3.0.0 and later, ParseResults will return True if either the item list is not empty or if the named results dict is not empty.
# generate an empty ParseResults by parsing a blank string with
# a ZeroOrMore
result = Word(alphas)[...].parse_string("")
print(result.as_list())
print(result.as_dict())
print(bool(result))
# add a results name to the result
result["name"] = "empty result"
print(result.as_list())
print(result.as_dict())
print(bool(result))
Prints:
[]
{}
False
[]
{'name': 'empty result'}
True
In previous versions, the second call to bool() would return False.
Minor enhancement to Word generation of internal regular expression, to emit consecutive characters in range, such as "ab", as "ab", not "a-b".
Fixed character ranges for search terms using non-Western characters in booleansearchparser, PR submitted by tc-yu, nice work!
Additional type annotations on public methods.
This discussion was created from the release pyparsing 3.0.7.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Fixed bug Parse actions skipped inside delimited_list #345, in which delimitedList changed expressions in place using expr.streamline(). Reported by Kim Gräsman, thanks!
Fixed bug Bug when defining WordStart with wordChars argument #346, when a string of word characters was passed to WordStart or WordEnd instead of just taking the default value. Originally posted as a question by Parag on StackOverflow, good catch!
Fixed bug
White
couldn't combine withset_results_name()
#350, in which White expressions could fail to match due to unintended whitespace-skipping. Reported by Fu Hanxi, thank you!Fixed bug 3.0 regression from 2.4.7 - regex generated for QuotedString #355, when a QuotedString is defined with characters in its quoteChar string containing regex-significant characters such as ., *, ?, [, ], etc.
Fixed bug in ParserElement.run_tests where comments would be displayed using with_line_numbers.
Added optional "min" and "max" arguments to
delimited_list
. PR submitted by Marius, thanks!Added new API change note in
whats_new_in_pyparsing_3_0_0
, regarding a bug fix in thebool()
behavior ofParseResults
.Prior to pyparsing 3.0.x, the
ParseResults
class implementation of__bool__
would returnFalse
if theParseResults
item list was empty, even if it contained named results. In 3.0.0 and later,ParseResults
will returnTrue
if either the item list is not empty or if the named results dict is not empty.Prints:
In previous versions, the second call to
bool()
would returnFalse
.Minor enhancement to Word generation of internal regular expression, to emit consecutive characters in range, such as "ab", as "ab", not "a-b".
Fixed character ranges for search terms using non-Western characters in booleansearchparser, PR submitted by tc-yu, nice work!
Additional type annotations on public methods.
This discussion was created from the release pyparsing 3.0.7.
Beta Was this translation helpful? Give feedback.
All reactions