Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3x import-time performance regression between 2.x and 3.x #362

Closed
asottile opened this issue Feb 5, 2022 · 8 comments · Fixed by #363
Closed

3x import-time performance regression between 2.x and 3.x #362

asottile opened this issue Feb 5, 2022 · 8 comments · Fixed by #363

Comments

@asottile
Copy link
Contributor

asottile commented Feb 5, 2022

👋 I'm a bit down a rabbit hole so I'll explain my journey and how I got here

I was taking a look at the newest version of pip today and I noticed it was visibly slower than before. a pretty noticeable half second pause on startup (450-500ms)

I did a little bit of profiling and noticed that almost half of that time (minus the base interpreter startup) was spent importing pyparsing and it felt like it was slower than before

I poked around a little bit and noticed that the performance regressed pretty significantly between 2.4.7 and 3.0.0

here's a comparison of some of the import times there (note that these are ~best of 5 which isn't necessarily a super useful representation of speed -- but it's enough to show significance here)

base interpreter startup

(essentially import site) -- I'm using python 3.8.10 here on ubuntu 20.04

$ time python3 -c ''

real	0m0.020s
user	0m0.020s
sys	0m0.000s

2.4.7

$ time python3 -c 'import pyparsing'

real	0m0.047s
user	0m0.043s
sys	0m0.004s

3.0.0

$ time python3 -c 'import pyparsing'

real	0m0.169s
user	0m0.168s
sys	0m0.000s

and just to confirm it's still present on the latest version, this is 938f59d

$ time python3 -c 'import pyparsing'

real	0m0.169s
user	0m0.169s
sys	0m0.000s

profiling

I did a bit of profiling, it looks like it spends ~75% of the time compiling regular expressions -- most of it coming from pyparsing.core:Regex.__init__ -- I'll attach a svg of the profile below

profile svg:

log

regressions (?)

I did some bisection using this script:
import argparse
import subprocess
import sys
import time


def main() -> int:
    parser = argparse.ArgumentParser()
    parser.add_argument('--best-of', type=int, default=5)
    parser.add_argument('--cutoff', type=float, default=.1)
    args = parser.parse_args()

    best = None

    for i in range(args.best_of):
        t0 = time.monotonic()
        subprocess.check_call((sys.executable, '-c', 'import pyparsing'))
        t1 = time.monotonic()

        duration = t1 - t0
        if best is None or duration < best:
            best = duration

    print(f'best of {args.best_of}: {best:.3f}')
    return best >= args.cutoff


if __name__ == '__main__':
    raise SystemExit(main())

the nice thing about this script is it lets me set thresholds and find each regression here

here's some thresholds as well as their commits:

  • 90ms threshold, 98ms best of 5: e2fb9f2
  • 120ms threshold, 163ms best of 5: aab37b6

these seem to be the two most impactful changes to startup time

ideas

optimizing this is potentially a little annoying, but I think the best thing that could be done here is to lazily compile those regular expressions -- perhaps by moving the regex object to a property? or lazily constructing the Regex instance ? or if python3.7+ is targetted it could use module-level __getattr__ to get some further wins

@ptmcg
Copy link
Member

ptmcg commented Feb 5, 2022

Excellent notes, thanks! I did some similar lazy init in the unicode submodule, but was not aware that Regex had similar issues.

@ptmcg
Copy link
Member

ptmcg commented Feb 5, 2022

Probably the lowest-risk is to move the regex compile for Regex out of its init method and into parse_impl. Most of these regex expressions probably don't need to be compiled at all by many parsers, so having Regex save re.compile until the first time it has to parse will convert these compile to just string assignments.

Can you give me an idea of any urgency on this fix?

@asottile
Copy link
Contributor Author

asottile commented Feb 5, 2022

I don't have any personal stake in this -- but I've noticed in the past that pyparsing has always been one of the more heaving imports and finally decided to look into it today

it does for instance make pip pretty slugging to use, but that's also not really that much of a regression there

@ptmcg
Copy link
Member

ptmcg commented Feb 5, 2022

Deferring the re compiles until parse time reduces import time as captured using your script from .187-.203s to .125-.140s. Shaving ~60ms on my slow Windows laptop.

I wonder how much of the 2.4.7 vs 3.x increase is due to the breakup of pyparsing across multiple files?

@asottile
Copy link
Contributor Author

asottile commented Feb 5, 2022

I profiled every mainline commit between 2.4.7 and 3.0.0 and there's ~basically just those two bumps -- the reorg didn't really seem to make a difference as far as I could tell

the full log:
$ git log --format=%h --first-parent pyparsing_2.4.7..pyparsing_3.0.0 | xargs --replace bash -c '(echo {} && git checkout -q {} && venv/bin/python3 -m prof --cutoff 9001 && git show --name-only --format=%s {}) | xargs | sed -r "s/([^ ]+) ([^ ]+) (.*)/\1\t\2\t\3/g"' | tee log
0352555	0.161	update version timestamp; prep for release pyparsing/__init__.py
895693b	0.162	with_line_numbers enhancements: better display of separate lines in Unicode mode; configurable eol_mark character CHANGES docs/HowToUsePyparsing.rst pyparsing/testing.py
fa7c27e	0.165	Clean up warning and exception messages with oneOf -> one_of pyparsing/helpers.py
73c84d7	0.168	Update generated class diagram docs/_static/pyparsingClassDiagram_3.0.0.jpg
b3e75f8	0.160	Added global method `autoname_elements()` CHANGES docs/HowToUsePyparsing.rst docs/whats_new_in_3_0_0.rst pyparsing/__init__.py pyparsing/core.py tests/test_unit.py
e26165e	0.164	Add missing globals() to class diagram; rename .jpg to include 3.0.0 version docs/_static/pyparsingClassDiagram_3.0.0.jpg docs/pyparsing_class_diagrm.puml
368b255	0.162	Add * marker to results name annotations in railroad diagram if listAllMatches=True pyparsing/diagram/__init__.py
a5631ca	0.161	Separated 3.0.0.final changes from the 3.0.0 version in CHANGES, so that it
6778667	0.162	Updated version timestamp prep for release. pyparsing/__init__.py
5571057	0.163	Updated CHANGES, HowToUsePyparsing.rst, and whats_new_in_3_0_0.rst to fill in missing features and bug fixes CHANGES docs/HowToUsePyparsing.rst docs/whats_new_in_3_0_0.rst
bd95446	0.163	Added omitted names in ParseBaseException, globals, and ParserElement CHANGES
48f9fe2	0.164	Added omitted names in ParseBaseException, globals, and ParserElement docs/_static/pyparsingClassDiagram.jpg
ded0a85	0.162	Added omitted names in ParseBaseException, globals, and ParserElement docs/pyparsing_class_diagrm.puml
a381b15	0.164	Added parser_element to synonymize with parserElement in ParseBaseException docs/whats_new_in_3_0_0.rst pyparsing/exceptions.py
686852f	0.167	Added support for python -W warning option to call enable_all_warnings() at startup. Also detects setting of PYPARSINGENABLEALLWARNINGS environment variable to any non-blank value. CHANGES docs/HowToUsePyparsing.rst pyparsing/__init__.py pyparsing/core.py tests/test_unit.py
3edde38	0.166	Added support for python -W warning option to call enable_all_warnings() at startup. Also detects setting of PYPARSINGENABLEALLWARNINGS environment variable to any non-blank value. docs/whats_new_in_3_0_0.rst
89b5b4a	0.164	Update some internal type annotations pyparsing/core.py
940636a	-1	Update some internal type annotations pyparsing/core.py
aab37b6	0.161	Modified helpers common_html_entity and replace_html_entity() to use the HTML entity definitions from html.entities.html5 CHANGES pyparsing/helpers.py tests/test_unit.py
69b6c5a	0.099	Fix set_parse_action type definitions, and docstring pyparsing/core.py
3569908	0.100	Tighten up determination of identbodychars to use _*.isidentifier() pyparsing/unicode.py
79aa181	0.098	Enhanced args to with_line_numbers CHANGES pyparsing/testing.py
a6f335f	0.099	Add some usage tips for diagramming to HowToUsePyparsing.rst; update date and e-mail docs/HowToUsePyparsing.rst
05b777b	0.099	Guard against empty ParseExpressions pyparsing/__init__.py pyparsing/core.py pyparsing/diagram/__init__.py tests/test_unit.py
f437bab	0.099	Fix named fields returned by common.url expression; add more common.* items to HowToUsePyparsing.rst CHANGES docs/HowToUsePyparsing.rst pyparsing/common.py tests/test_unit.py
0334089	0.098	Prep for final 3.0.0 release, update author email address pyparsing/__init__.py setup.py
686d95f	0.097	Update saved class diagram image files docs/_static/pyparsingClassDiagram.jpg docs/_static/pyparsingClassDiagram.png docs/_static/pyparsingClassDiagram_1.5.2.jpg
367ceec	0.099	Update class diagram, with note and layout tweaks docs/pyparsing_class_diagrm.puml
2173498	0.098	Test Python 3.10 (#308) .travis.yml tox.ini
e8c90c5	0.099	Updated class diagram docs/pyparsing_class_diagrm.puml
58126af	0.098	Corrections in whats_new_in_3_0_0.rst docs/whats_new_in_3_0_0.rst
b0657d9	0.099	Bump version timestamp pyparsing/__init__.py
36ebaa2	0.098	Fix typos in whats_new_in_3_0_0.rst docs/whats_new_in_3_0_0.rst
09b2a15	0.098	Clean up bullet lists in docstrings pyparsing/actions.py pyparsing/common.py pyparsing/core.py pyparsing/exceptions.py pyparsing/helpers.py pyparsing/results.py pyparsing/testing.py
47cedb9	0.098	Update whats_new_in_3_0_0.rst doc to reflect new AtLineStart and AtStringStart classes docs/whats_new_in_3_0_0.rst
5c75f1c	0.098	Fix docstring of set_debug_actions to fix markup pyparsing/core.py
bda854c	0.098	Fix docstring of set_debug_actions to reflect added cache_hit bool argument, and add type annotations pyparsing/core.py
04d0cc7	0.099	Better example of exception report showing a full word in the source string CHANGES
170e7ca	0.097	Fix python_requires in setup.py setup.py
64c7596	0.099	Fixup type annotations pyparsing/core.py pyparsing/helpers.py pyparsing/util.py
47133a6	0.099	Code cleanup CHANGES pyparsing/__init__.py pyparsing/core.py tests/test_unit.py
d2cb388	0.098	Fixed issue #272, reported by PhasecoreX, when LineStart() expressions would match expressions that were not necessarily at the beginning of a line; added AtLineStart and AtStringStart classes tests/test_unit.py
01ae706	0.098	Fix type annotation for ranges in unicode_sets; make _get_chars_for_ranges a lazyclassproperty examples/simpleBool.py
4ce63a9	0.100	Fix type annotation for ranges in unicode_sets; make _get_chars_for_ranges a lazyclassproperty examples/simpleBool.py
4e306ed	0.099	Fix type annotation for ranges in unicode_sets; make _get_chars_for_ranges a lazyclassproperty pyparsing/__init__.py pyparsing/unicode.py
d9b2b46	0.101	Add numbers and punctuation to Cuneiform class examples/cuneiform_python.py
8ac3934	0.099	Fix example for with_line_numbers in CHANGES CHANGES
16b7316	0.099	Blacken and update version time pyparsing/__init__.py pyparsing/helpers.py pyparsing/testing.py tests/test_unit.py
49add35	0.099	Added start_line and end_line args to with_line_numbers, and more docstring CHANGES pyparsing/helpers.py pyparsing/testing.py tests/test_unit.py
66ec9e9	0.096	Added start and end args to with_line_numbers, and more docstring pyparsing/testing.py
269633d	0.097	Added with_line_numbers method to pyparsing_testing CHANGES pyparsing/testing.py
9adaf2e	0.099	Allow multiplying an expr by 0 or (0,0) pyparsing/core.py pyparsing/helpers.py tests/test_unit.py
8d1083f	0.098	Some tweaks to cuneiform_python.py examples/cuneiform_python.py
c8174e7	0.097	Add cuneiform_python.py example CHANGES examples/cuneiform_python.py
911b85d	0.100	Blacken and update version time pyparsing/__init__.py pyparsing/core.py
638a0b4	0.099	Fix to IndentedBlock where first line of block was suppressed; use Empty().preParse to advance to printable character if not already there CHANGES pyparsing/helpers.py
e8060b2	0.098	Include expr name in debug fail messages to make it easier to sync up match vs success/fail debug messages CHANGES pyparsing/core.py tests/test_unit.py
b9b466b	0.098	Add return types in results.py, and small perf change in __bool__ pyparsing/results.py tests/test_unit.py
6854842	0.099	Cleanup whats_new_in_3_0_0.rst doc - add pyparsing_common.url, make backward compat synonyms more prominent; fix instructions on pip install for railroad diags docs/whats_new_in_3_0_0.rst
e9344d1	0.099	Code cleanup: replaced dynamic attrs in ParseBaseException with properties, some addtional type annotations CHANGES pyparsing/__init__.py pyparsing/core.py pyparsing/exceptions.py pyparsing/results.py tests/test_unit.py
c10e862	0.098	Update version timestamp, blackening pyparsing/__init__.py tests/test_unit.py
5823e72	0.096	Fix ParseResults return of  for dunder methods, which breaks some Python internals (Issue #208) CHANGES pyparsing/results.py tests/test_unit.py
265bbd5	0.097	Fix handling of ParseFatalExceptions in a MatchFirst (reported in Issue #251) CHANGES pyparsing/core.py tests/test_unit.py
357b5f5	0.099	Cleanup str() representations for And and Opt; remove extraneous {}s pyparsing/core.py
2583e12	0.098	Code cleanup: use raise-from syntax; use set operations instead of str operations; fix some type annotations pyparsing/core.py
6438c3f	0.100	Update timestamp; reblack __init__.py pyparsing/__init__.py
7bff24f	0.100	Add pyparsing_common.url to urlExtractorNew.py CHANGES examples/urlExtractorNew.py pyparsing/common.py
29d2d8e	0.102	Handle types passed to ParseResults (Py3.9 behavior change) (#276) CHANGES pyparsing/__init__.py pyparsing/results.py tests/test_unit.py
e2fb9f2	0.098	Add url expression to pyparsing_common (#249) CHANGES pyparsing/common.py tests/test_unit.py
6bdee2f	0.065	Bump version time too pyparsing/__init__.py
96f08e1	0.066	Address #188 - __eq__ should call matches with parse_all=True pyparsing/core.py
2f4aabc	0.066	Bump version number for next release (call it rc2 for now, but hopefully it will be the final) pyparsing/__init__.py
f7f8c9c	0.065	Set version to use rc, add date to CHANGES, reorder items a bit CHANGES
a86ed0e	0.066	Set version to use rc if release level start with c pyparsing/__init__.py
6b51ff7	0.066	The blackening pyparsing/core.py pyparsing/diagram/__init__.py pyparsing/helpers.py pyparsing/util.py
d714f45	0.068	Bump __version_time__ pyparsing/__init__.py
2a1df6c	0.066	parseFile and create_diagram methods now accept pathlib.Path arguments CHANGES pyparsing/core.py
c1f6cfd	0.063	Update eval_arith.py to have better representation of true and false eval expressions examples/eval_arith.py
69f5e0c	0.064	Reformat code for railroad_diagram_demo.py examples/railroad_diagram_demo.py
a5130a4	0.062	Only collapse re character ranges if they consist of more than 3 characters pyparsing/core.py pyparsing/util.py tests/test_unit.py
ecd4dc0	0.062	Only collapse re character ranges if they consist of 4 or more characters pyparsing/util.py
68a7c5b	0.062	Better type matching for infix_notation operator specs pyparsing/helpers.py
64749ea	0.063	Optimization in infixNotation pyparsing/helpers.py
e26b74e	0.061	Add test for optimized Word with max>0 tests/test_unit.py
e7fde50	0.063	Add missing setName() calls; use new identchars and identbodychars to define identifier pyparsing/common.py
dfe7593	0.062	Word optimization when using max argument; fix create_diagram -> NoReturn s/b None pyparsing/core.py
dfc7d75	0.063	226 railroad updates (#298) CHANGES docs/HowToUsePyparsing.rst docs/whats_new_in_3_0_0.rst examples/chemicalFormulas.py examples/delta_time.py examples/jsonParser.py examples/make_diagram.py examples/mozillaCalendarParser.py examples/railroad_diagram_demo.py examples/simpleBool.py examples/simpleSQL.py pyparsing/__init__.py pyparsing/core.py pyparsing/diagram/__init__.py pyparsing/helpers.py tests/test_diagram.py
11fda28	0.061	Docs cleanup docs/HowToUsePyparsing.rst docs/whats_new_in_3_0_0.rst
1ed653a	0.062	Small perf tweaks pyparsing/__init__.py pyparsing/core.py pyparsing/results.py
19cf57e	0.062	Minor blackening pyparsing/core.py
f53d6b8	0.062	Update docstrings to use new-style snake_case names pyparsing/__init__.py pyparsing/core.py pyparsing/helpers.py
5b3d2cd	0.060	Update docs to use new-style snake_case names, add some missing blurbs to whats_new_in_3_0_0.rst, and reformat CloseMatch change blurb in CHANGES CHANGES docs/whats_new_in_3_0_0.rst
61a5088	0.064	add a caseless parameter to the CloseMatch class (#281) CHANGES pyparsing/core.py tests/test_unit.py
2753016	0.061	Fix test issue; update version time pyparsing/__init__.py tests/test_simple_unit.py
ec59ea1	0.063	mypy cleanup pyparsing/core.py pyparsing/helpers.py pyparsing/results.py pyparsing/unicode.py pyparsing/util.py
bbb78fb	0.062	Make static methods staticmethods tests/test_simple_unit.py
b2329c0	0.060	Add note about names and using 3.0 docs for 2.4.7 environments. docs/HowToUsePyparsing.rst
e4ab1fe	0.064	Expand error message when failing to import .diagram in ParserElement.create_diagram() pyparsing/core.py
c40a741	0.060	Use pyparsing.Opt instead of deprecated Optional pyparsing/diagram/__init__.py
fae5e1d	0.061	Fix typo .github/SECURITY.md
69a8ab7	0.061	In 3.7, Callable cannot use NoReturn for a return type, must use None pyparsing/core.py
f495036	0.061	Fix annotations using Iterable, must import and use as IterableType so as not to confuse with collections.abc.Iterable. pyparsing/core.py pyparsing/helpers.py
bd817ca	-1	Merge branch master of https://github.com/pyparsing/pyparsing
92cf62f	-1	Adding type annotations CHANGES pyparsing/common.py pyparsing/core.py pyparsing/exceptions.py pyparsing/helpers.py
af8cb9e	0.057	Fix test bugs tests/test_unit.py
a3846e7	0.058	Add identchars and identbodychars symbols to make it easier to construct identifiers CHANGES docs/whats_new_in_3_0_0.rst pyparsing/__init__.py pyparsing/core.py pyparsing/unicode.py tests/test_unit.py
da02267	0.058	Fix f-string 3.6 compat bug in test_unit.py; rename __versionTime__ to __version_time__; code cleanups pyparsing/__init__.py pyparsing/core.py pyparsing/helpers.py tests/test_unit.py
b816a80	0.057	Additional unit tests for IndentedBlock, with bad indented code and indented code that skips unindent levels tests/test_unit.py
9149fcb	0.059	Fixed bug in QuotedString class when the escaped quote string is not a repeated character; reworked regex construction in QuotedString class (Issue #263) CHANGES pyparsing/core.py tests/test_unit.py
daf7a85	0.058	Add PEP-8 names for initial args pyparsing/core.py
e5994cc	0.059	Fix bug in Located class when used with a results name. (Issue #294) CHANGES pyparsing/core.py tests/test_unit.py
4f832b5	0.060	Update version time pyparsing/__init__.py
575903a	0.057	Add note on enable/disable memoization methods in whats_new_in_3_0_0.rst docs/whats_new_in_3_0_0.rst
cb86d46	0.057	It is to black tests/test_unit.py
555597d	0.058	Fix unit test that enables/disables memoization, to not interfere with test-level settings; add flag to enable verbose tracebacks for unit testing tests/test_unit.py
57e3314	0.058	Add support for Suppress(...) to suppress the skipped text CHANGES docs/whats_new_in_3_0_0.rst pyparsing/core.py tests/test_unit.py
54f975f	0.056	Fix old method names in comparison (#295) docs/HowToUsePyparsing.rst
8a3e5c3	0.058	More informative exception messages CHANGES pyparsing/exceptions.py pyparsing/util.py tests/test_unit.py
6c21860	0.054	Update version for next phase pyparsing/__init__.py
54d3b7b	0.054	Clean up number word parsers for better explanatory value. examples/number_words.py examples/one_to_ninety_nine.py
e063cce	0.055	Revert PEP8 naming in README.rst until 3.0 full release. README.rst
f28e4ac	0.054	Add simplified 1-99 example, extracted from number_words.py examples/one_to_ninety_nine.py
2d20dec	0.053	Update version time; prep for release pyparsing/__init__.py
ca941e0	0.054	Use new PEP-8 names in project README.rst README.rst
9863a3d	0.055	Sweep code for usage of Optional -> Opt; sweep HowToUsePyparsing.rst for legacy names docs/HowToUsePyparsing.rst pyparsing/common.py pyparsing/helpers.py
d55aad0	0.053	Sweep code for calls using legacy names pyparsing/__init__.py pyparsing/common.py pyparsing/core.py pyparsing/helpers.py pyparsing/results.py pyparsing/testing.py tests/test_simple_unit.py
b0b7d98	0.055	Update docs to include `delimited_list` added argument `allow_trailing_delim` CHANGES docs/whats_new_in_3_0_0.rst
04f3e63	0.053	Added PEP-8 notes to the whats_new_in_3_0_0.rst doc docs/whats_new_in_3_0_0.rst
18f3b9c	0.054	Add PEP-8 naming, with compatibility synonyms CHANGES docs/HowToUsePyparsing.rst pyparsing/__init__.py pyparsing/actions.py pyparsing/common.py pyparsing/core.py pyparsing/exceptions.py pyparsing/helpers.py pyparsing/results.py tests/test_simple_unit.py tests/test_unit.py
768bcd7	0.053	TravisCI not supporting 3.10 yet, leave out .travis.yml tox.ini
7bf571e	0.054	Fix Travis integration (still referenced 3.5, tho no longer supported Python for pyparsing 3) .travis.yml tox.ini
6067e7b	0.053	Remove Py3.5 from compatibility targets, add Py3.10, update version timestamp CHANGES pyparsing/__init__.py setup.py tox.ini
d3bceb9	0.053	Minor code cleanups examples/verilogParse.py pyparsing/core.py pyparsing/unicode.py tests/test_simple_unit.py tests/test_unit.py
9c53c41	0.054	Renumber test classes tests/test_unit.py
608b807	0.053	Fix internal bug in ParseResults.getName() (how did this ever work?) pyparsing/results.py
e5d8d99	0.053	Update 2020 dates to 2021, fix TravisCI badge in README.rst to use travis-ci.com instead of .org README.rst docs/conf.py docs/whats_new_in_3_0_0.rst
f22dcdc	0.054	Update __versionTime__; blacken core code and examples examples/LAparser.py examples/adventureEngine.py examples/apicheck.py examples/bigquery_view_parser.py examples/btpyparse.py examples/decaf_parser.py examples/eval_arith.py examples/excelExpr.py examples/idlParse.py examples/invRegex.py examples/left_recursion.py examples/number_words.py examples/pymicko.py examples/rosettacode.py examples/simpleSQL.py examples/sparser.py examples/statemachine/statemachine.py pyparsing/__init__.py pyparsing/actions.py pyparsing/core.py pyparsing/exceptions.py pyparsing/results.py pyparsing/testing.py pyparsing/util.py
1688592	0.055	Rename enable_left_recursion to enableLeftRecursion for consistency with other pyparsing names (left in enable_left_recursion synonym as omen of names to come); added notes to CHANGES and whats_new_in_3_0_0.rst; added left_recursion.py to examples. CHANGES docs/whats_new_in_3_0_0.rst examples/left_recursion.py pyparsing/__init__.py pyparsing/core.py
da91723	0.054	Disable SQL parse test when running with LR enabled (SQL parser uses packrat) tests/test_unit.py
219fa71	0.058	Merge branch left_recursion_support
f244321	0.055	Merge branch feature/left_recurse_Medeiros_etal
0e14999	0.051	Add allowTrailingDelim to delimitedList helper (#285) pyparsing/helpers.py tests/test_simple_unit.py
d108a29	0.051	Remove old language stating that parseString returns a list of matched strings, and clarify use of the returned ParseResults README.rst docs/HowToUsePyparsing.rst
5353ccd	0.051	Fix misc. documentation typos (#280) CHANGES docs/HowToUsePyparsing.rst docs/whats_new_in_3_0_0.rst examples/AcManForm.dfm examples/booleansearchparser.py examples/lucene_grammar.py examples/pymicko.py examples/pythonGrammarParser.py examples/searchparser.py examples/simpleArith.py examples/snmp_api.h pyparsing/diagram/__init__.py pyparsing_archive.py tests/json_parser_tests.py tests/test_unit.py
d27fd76	0.052	Remove setuptools import fallback to distutils.core (distutils.core use not recommended) setup.py
b5b1fdd	0.052	#261 - fix table name in sql2dot.py example CHANGES examples/sql2dot.py
9e8ad93	0.052	#271 - remove comparison with bytes in ParseResults._null_values CHANGES pyparsing/results.py
6e9b4c9	0.051	Update README.rst (#269) README.rst
f10fcf8	0.050	Update core.py (#259) pyparsing/core.py
32ac0bf	0.050	Update whats_new_in_3_0_0.rst (#258) docs/whats_new_in_3_0_0.rst
2f0f24d	0.050	Cleanup old file names and tests/__pycache__ files from MANIFEST.in MANIFEST.in
8cee9cf	0.051	Update CHANGES file with version release dates CHANGES
3ef0c12	0.052	Fix minor typos and add Located to `__all__` list pyparsing/__init__.py
2383c32	0.051	Add Python 3.9 support (#256) .travis.yml setup.py tox.ini
2896fad	0.050	Deprecate `locatedExpr` in favor of new `Located` class CHANGES docs/whats_new_in_3_0_0.rst pyparsing/core.py pyparsing/helpers.py tests/test_unit.py
c3be8ac	0.052	Hide internal null_values list in ParseResults class pyparsing/results.py
d7fc7e5	0.050	Move OnlyOnce out of core.py and into actions.py pyparsing/actions.py pyparsing/core.py
3abd462	0.050	Update version for next dev phase pyparsing/__init__.py
2dd2e2b	0.052	Add IndentedBlock class; made vertical keyword arg more visible when creating railroad diags; changed create_diagram from monkeypatch to included method on ParserElement; better debug exception if Dict is constructed with non-Group expression CHANGES docs/whats_new_in_3_0_0.rst examples/indentedGrammarExample.py examples/indented_block_example.py examples/number_words.py examples/verilogParse.py pyparsing/__init__.py pyparsing/core.py pyparsing/diagram/__init__.py pyparsing/helpers.py tests/test_unit.py
96e0fab	0.051	Add number_words.py example; update diagramming code examples/number_words.py pyparsing/diagram/__init__.py
27dc324	0.051	minor perf changes II pyparsing/helpers.py pyparsing/results.py pyparsing/util.py
7f68a2a	0.052	minor perf changes pyparsing/core.py pyparsing/results.py
5811c79	0.051	Remove py39-dev from Travis-CI .travis.yml tox.ini
14ed25a	0.051	Remove black from tox.ini, Travis CI black is not aligned with local black; add py39-dev version - this time I mean it! .travis.yml
26dc843	0.051	Remove black from tox.ini, Travis CI black is not aligned with local black; add py39-dev version pyparsing/__init__.py tox.ini
3c495db	0.051	ParseResults.List class to support returning an actual list from a parse action, plus aslist and asdict args to Group and Dict classes to emit native Python types instead of ParseResults; also update repr() output of ParseResults to include the type name instead of just a bare tuple. CHANGES examples/jsonParser.py pyparsing/core.py pyparsing/results.py tests/json_parser_tests.py tests/test_unit.py
22027ba	0.050	There will be black examples/test_bibparse.py
34be5a2	0.051	test_bibparse includes parsed strings with leading space, no longer included in output examples/test_bibparse.py
989c506	0.051	Issue #244, fixed debug output to indicate correct parse location; updated setDebug output to include current text line and parse location CHANGES pyparsing/core.py pyparsing/util.py tests/test_unit.py
a5c7717	0.052	Updated HowToUsePyparsing.rst and whats_new_in_3_0_0.rst docs docs/HowToUsePyparsing.rst docs/whats_new_in_3_0_0.rst
64e3245	0.051	Exclude /examples from black in tox, since examples are now inexplicably failing black formatting tox.ini
5713fba	0.050	Fixed bugs in Each with ZeroOrMore and OneOrMore (first matched element enclosed in extra nesting level; results names not maintained; did not handle mix with required expressions) CHANGES pyparsing/core.py tests/test_unit.py
1add439	0.052	Fix enum auto() incompat with Py3.5 pyparsing/core.py pyparsing/helpers.py
508750e	0.052	Convert SyntaxWarnings to ValueError and TypeError exceptions; change diagnostics to an enum, and add enable_diag(), disable_diag() and enable_all_warnings() methods; clean up pyparsing imports in test_unit.py CHANGES docs/HowToUsePyparsing.rst pyparsing/core.py pyparsing/helpers.py tests/test_unit.py
af90c6d	0.049	Second markup cleanup pass docs/HowToUsePyparsing.rst
e12361f	0.050	Update HowToUsePyparsing.rst to include diagnostics, and general markup cleanup docs/HowToUsePyparsing.rst
ca2dd9f	0.051	Add __version_info__ module attribute, similar in content and structure to sys.version_info CHANGES pyparsing/__init__.py
4e25896	0.050	Add * markers to debug output to indicate cached parse expression try/pass/fail events (which were previously omitted from debugging output) CHANGES pyparsing/core.py tests/test_unit.py
c1c9c8d	0.050	Add lookahead on matching identifiers to ensure we
1a2920d	0.051	Follow-up to PR #233 CHANGES pyparsing/core.py
a49e569	0.050	Remove identChars override from Keyword.copy (#233) pyparsing/core.py tests/test_unit.py
bcb8242	0.050	Update lua_parser.py example to include associative arrays and more complete infix notation operators examples/lua_parser.py
71e061e	0.050	Better display of single-character Words pyparsing/core.py tests/test_unit.py
c1e365b	0.050	Add size spec to default Word repr output CHANGES pyparsing/core.py tests/test_unit.py
de7c442	0.050	Nicer default name for QuotedStrings; clean out more Py2 vestigial code pyparsing/__init__.py pyparsing/core.py
11cdffe	0.051	Replace last-century % string interp with .format() usage pyparsing/actions.py pyparsing/core.py pyparsing/exceptions.py pyparsing/results.py
31679fa	0.050	Fixing generated default name for QuotedString (#229) pyparsing/core.py
bd57081	0.050	Docstring fixes; cleanup dead/Py2 vestigial code pyparsing/core.py pyparsing/results.py pyparsing/util.py
aa822a6	0.049	Docstrings cleanup; add encoding argument to parseFile; additional unit tests to improve ParseResults coverage pyparsing/__init__.py pyparsing/core.py pyparsing/helpers.py pyparsing/results.py tests/test_unit.py
eb7f68e	0.053	The metod getTokensEndLoc no longer exists (#228) docs/HowToUsePyparsing.rst
5c06070	0.050	infixNotation unit tests require infixNotation bug fixes! pyparsing/helpers.py
c104123	0.050	infixNotation unit tests to address missing coverage and features; rename infixNotation tests to meaningful names tests/test_unit.py
6e91e87	0.049	Sphinx and docstring fixes docs/pyparsing.rst pyparsing/exceptions.py pyparsing/results.py
ad0af4e	0.050	It is to blacken pyparsing/core.py
246103d	0.050	When warning for uninitialized Forward, look up stack to parseString function call to give correct stacklevel for the warning pyparsing/core.py
ef1ec37	0.050	Fixed traceback trimming, and added ParserElement.verbose_traceback save/restore to reset_pyparsing_context() CHANGES pyparsing/core.py pyparsing/testing.py tests/test_unit.py
466c907	0.051	Add expression names and restructure relative time and day expressions based on reviewing railroad diag examples/delta_time.py
04a631f	0.052	Simplify running railroad diagram examples examples/make_diagram.py
0cad4a6	0.049	Update version to stage for next release work; fix typo in CHANGES file CHANGES pyparsing/__init__.py
0448be4	0.051	Additional unit tests tests/test_unit.py
8f58870	0.050	Minor code cleanups, remove more Py2-compatibilty code pyparsing/__init__.py pyparsing/core.py
d364aea	0.051	Fix bug when using pyparsing_testing.reset_pyparsing_context as a context manager, suppressing raised exceptions pyparsing/testing.py
78b46d1	0.052	Assert packrat not enabled in base test case; log packrat status and cache type in all cases tests/test_unit.py
8375864	0.052	Blacken test_examples.py tests/test_examples.py
20dfaac	0.052	Add make_diagram.py to examples to demonstrate creating railroad diags for selected examples CHANGES examples/TAP.py examples/delta_time.py examples/idlParse.py examples/jsonParser.py examples/lucene_grammar.py examples/make_diagram.py examples/oc.py examples/parsePythonValue.py examples/protobuf_parser.py examples/select_parser.py examples/sexpParser.py tests/test_examples.py
b3edef0	0.050	Update CHANGES to reflect Issue #227 CHANGES
1ed0af7	0.052	Update unicode ranges (compute by interrogating unicodedata by language name) - Issue #227 pyparsing/unicode.py
3476890	0.051	Blackening pyparsing/testing.py tests/test_unit.py
c4435b9	0.050	Restructure unit tests to do proper testing with and without packrat enabled pyparsing/testing.py pyparsing/util.py tests/test_unit.py
56dee11	0.051	Revert to Python 3.7.1 for most compatibility; rewrite explain() unit test to be more tolerant of variations in TypeError str formatting .travis.yml tests/test_unit.py
cfef3df	0.049	Force later version of Python 3.7, default is 3.7.1 .travis.yml
a51d66b	0.050	Travis CI builds on Ubuntu 16.04, for updated Python versions .travis.yml
01ead0e	0.052	Modify expected explain string to use Python version-specific TypeError tests/test_unit.py
2607db6	0.050	More thorough ParseException.explain testing pyparsing/exceptions.py tests/test_unit.py
5a3ae44	0.049	Sphinx config cleanup docs/conf.py docs/index.rst
b713978	0.050	Add unit tests for miscellaneous ParseException methods/behavior tests/test_unit.py
09681b4	0.050	Collapse _checkRecursion methods; moved 3.0.0 summary from CHANGES to whats_new_in_3_0_0.rst; cleaned up docstrings, Word() examples, restored setName() docstring; added example to ParseException.explain() CHANGES docs/index.rst docs/whats_new_in_3_0_0.rst pyparsing/core.py pyparsing/exceptions.py
efb7960	0.050	Diagram improvements IV (#225) docs/HowToUsePyparsing.rst docs/_static/json.html docs/_static/sql_railroad.html pyparsing/diagram/__init__.py tests/test_diagram.py
e91acdf	0.051	Follow-up to default vs custom name tracking, from Issue #223 pyparsing/core.py tests/test_unit.py
60285bc	0.047	Add recurse() method to simplify navigating through hierarchy of ParserElements within a pyparsing parser CHANGES pyparsing/__init__.py pyparsing/core.py
2d11634	0.048	Diagram Improvements Episode III: Revenge of the Setuptools (#224) MANIFEST.in MANIFEST.in_bdist pyparsing/diagram/__init__.py pyparsing/diagram/template.jinja2 setup.py
6fc0f32	0.047	Add explicit guard to setup.py against installs using Python < 3.5, for those who do python setup.py install directly instead of going thru pip setup.py
af13023	0.047	strRepr cleanup, remove replicated __str__ methods CHANGES pyparsing/__init__.py pyparsing/core.py pyparsing/util.py
788298e	0.048	warn_on_assignment_to_Forward not working on PyPy - disable test for now if running on PyPy tests/test_unit.py
0a00334	0.048	warn_on_assignment_to_Forward not working on PyPy - disable test for now if running on PyPy CHANGES tests/test_unit.py
464ac71	0.050	Add new warnings about common errors using Forward: warn_on_parse_using_empty_Forward warns when failing to attach an expression; warn_on_assignment_to_Forward warns when using = instead of <<= CHANGES pyparsing/__init__.py pyparsing/core.py tests/test_unit.py
6267bb5	0.048	Add CHANGES blurb for new ignoreWhitespace and leaveWhitespace methods with recurse arguments CHANGES
17aaf61	0.048	Additional configuration for `skipWhitespace` and `leaveWhitespace` (#219) pyparsing/core.py tests/test_simple_unit.py
1181390	0.046	Fix ParseResults.dump() to show both keys *and* lower-level structures CHANGES pyparsing/results.py
2a49381	0.048	Add CHANGES blurb for new railroad-diagram parser documentation feature CHANGES
22940c8	0.047	Railroad Diagram Improvements (#220) docs/HowToUsePyparsing.rst docs/_static/json.html pyparsing/diagram/__init__.py pyparsing/diagram/template.jinja2 tests/test_diagram.py
58c171b	0.048	Railroad Diagrams (#218) pyparsing/diagram/__init__.py pyparsing/diagram/template.jinja2 setup.py tests/test_diagram.py tox.ini
2952e92	0.048	Add GoToColumn test (#217) tests/test_unit.py
6f1b33c	0.048	Expand description of ParseException.explain() and explain_exception() CHANGES
0561ff9	0.049	Fix up lua parser to parse scripts of zero-or-more statements examples/lua_parser.py
bc08887	0.048	Added lua parser example (see #212) CHANGES examples/lua_parser.py
6fc6fa9	0.048	Update HowTo doc, address comments in #213 docs/HowToUsePyparsing.rst
cb7f7fd	0.048	CHANGES blurb for PR #216 CHANGES
6f3b5f0	0.049	makeRomanNumeral bug fix, added MMMMM test (#216) examples/romanNumerals.py
d0d38c1	0.048	Add misc unit tests for core elements with missing coverage (#214) pyparsing/core.py tests/test_unit.py
507fab2	0.046	Imports cleanup in unit tests (#215) tests/test_unit.py
75bac59	0.047	Convert internal imports to relative imports, to support projects that vendor pyparsing CHANGES pyparsing/__init__.py pyparsing/actions.py pyparsing/common.py pyparsing/core.py pyparsing/exceptions.py pyparsing/helpers.py pyparsing/testing.py
42e7022	0.048	Added unit test for modified countedArray metadata (#209) tests/test_unit.py
79fc40d	0.050	Parser Element and Keyword tests (#199) tests/test_unit.py
827f615	0.048	Pop counter token and return rest instead of dropping all tokens in countedArray (#209) pyparsing/helpers.py tests/test_simple_unit.py tests/test_unit.py
3993457	0.047	remove Regex docstring notes that reference no-longer-supported replacement of internal import of re with other RE modules such as regex pyparsing/core.py
871037d	0.048	import and exception types cleanup in statemachine examples examples/statemachine/libraryBookDemo.py examples/statemachine/statemachine.py
a43146a	0.051	black cleanup examples/excelExpr.py
203fa36	0.048	change some lambdas to explicit methods for clarity (see discussion in #207); deleted duplicated examples (commit *all* changes this time) examples/chemicalFormulas.py examples/excelExpr.py examples/fourFn.py examples/holaMundo.py examples/htmlTableParser.py examples/list1.py examples/parseListString.py examples/parsePythonValue.py examples/shapes.py examples/simpleArith.py examples/stackish.py
813ba3b	0.048	Code cleanup in examples; move test code into main for bigquery_view_parser.py; change some lambdas to explicit methods for clarity (some discussion in #207); deleted duplicated examples examples/bigquery_view_parser.py
486b1fd	0.048	Fixed bug in ParseResults repr() which showed all matching entries for a results name, even if listAllMatches was set to False (Issue #205) CHANGES pyparsing/__init__.py pyparsing/core.py pyparsing/results.py tests/test_unit.py
72f2c5a	0.051	enable packrat parsing in all examples using infixNotation examples/bigquery_view_parser.py examples/eval_arith.py examples/invRegex.py examples/simpleArith.py examples/simpleBool.py examples/simpleSQL.py
1881e43	0.059	prep for next release version development pyparsing/__init__.py
e3b4aa4	0.051	Fold in 2.4.7 change notes for consolidate change list CHANGES
6a18916	0.051	Thanks for the help CHANGES
2e1d88c	0.051	Staging changes for 3.0.0a1 alpha pre-release CHANGES pyparsing/__init__.py setup.py
8d36d77	0.051	Enhanced error messages and error locations when parsing fails on the Keyword or CaselessKeyword classes due to the presence of a preceding or trailing keyword character. See issue #201. CHANGES pyparsing/core.py pyparsing/exceptions.py tests/test_unit.py
61af31e	0.051	Remove deprecated space escapes from docstrings (#202) pyparsing/core.py pyparsing/helpers.py
7eae921	0.051	Refactor ParseException explain() static method into a staticmethod and an instance method on ParseBaseException CHANGES pyparsing/exceptions.py tests/test_unit.py
90f6fa2	0.050	Add OnlyOnce docstring, error message and unit test (#193) pyparsing/core.py tests/test_unit.py
44f9d45	0.048	Add ParseResults unit tests (#198) tests/test_unit.py
fcbad04	0.048	Fix potential FutureWarning with generated regex; minor reformat of runTests output to break at test comments if any CHANGES pyparsing/core.py pyparsing/util.py
96fe268	0.048	Docstring formatting changes (#197) pyparsing/__init__.py pyparsing/core.py pyparsing/helpers.py pyparsing/testing.py pyparsing/util.py
963a624 0.047
eec1d57	0.087	Fixed bug in regex definitions for real and sci_real expressions in pyparsing_common. Issue #194. CHANGES pyparsing/common.py
6a0daf5	0.089	Blacken unit test changes tests/test_unit.py
072358f	0.091	Fixup matchPreviousExpr tests tests/test_unit.py
db30230	0.089	New unit tests (#192) pyparsing/core.py tests/test_unit.py
5411599	0.096	Housekeeping (#191) pyparsing/core.py pyparsing/helpers.py tests/test_unit.py
dc1ca68	0.089	Blacken changes examples/delta_time.py tests/test_unit.py
5dff08f	0.092	Update changes to reflect recent bug fix work CHANGES
30e25f0	0.089	Fix bug in Each when using Regex, Regex would get parsed twice (issue #183) pyparsing/core.py tests/test_unit.py
ecbe544	0.092	Fix bug in delta_time when number of seconds/minutes/hours > 999 (confusion with 24-hour time) examples/delta_time.py
5fd881f	0.087	Test code cleanup; remove VERBOSE global and activate all related print() statements; remove dead ParseTest class; cleanup testSkipToParserTests test using assertRaisesParseException; fix parsers in pickle compatibility tests, and remove PickleTest_Greeting class as ParseResults wrapper; change test classes created using type() with more explicit class definitions tests/test_unit.py
7aeb4bb	0.089	Cleanup (object) from class definitions; add __slots__ to _ParseResultsWithOffset, and streamline args for ParseResults.__new__ pyparsing/core.py pyparsing/results.py
ff8b6ab	0.088	ensure test can fail (#178) examples/eval_arith.py
664d9e7	0.090	Add Black formatting Git hook (#180) .pre-commit-config.yaml tests/README.md tests/requirements.txt tox.ini
22c76ec	0.092	Add unit tests to expand test coverage (#184) pyparsing/core.py tests/test_unit.py
2bd5afb	0.097	Rename (#179) pyparsing/results.py
d9a1bc8	0.094	Add unit test sequences for small and unbounded packrat caches tests/test_unit.py
8d9ab59	0.097	Shorten pyparsing tracebacks, to clear out internal pyparsing calls; plus some micro-optimizations when using packrat parsing CHANGES pyparsing/core.py pyparsing/results.py pyparsing/util.py
2e9a47c	0.091	Update unit tests to use pyparsing_test assert methods tests/test_unit.py
887a022	0.089	Some unittest.TestCase cleanups (#175); black reformat of core.py pyparsing/core.py tests/test_unit.py
40cbbf3	0.090	Added new warning warn_on_match_first_with_lshift_operator to warn when doing `fwd << a | b`; fixed potential FutureWarning when including unescaped [ in a regex range definition. CHANGES pyparsing/core.py pyparsing/util.py tests/test_unit.py
1c57a6d	0.090	Smedberg/various minor fixes (#173) examples/bigquery_view_parser.py
104feb5	0.090	Add security policy .github/SECURITY.md
009704d	0.090	Create FUNDING.yml .github/FUNDING.yml
ba1eb22	0.089	Update version timestamp, since numerous changes have been made pyparsing/__init__.py
8f29483	0.090	Break up testMiscellaneousParserTests unit test into separate test methods tests/test_unit.py
062778c	0.089	Rollforward infixNotation ternary op fix from 2.4.6 branch, plus related unit test; change TestParseResultsAsserts to mixin instead of subclass; rollforward 2.4.6 CHANGES blurb from 2.4.6 branch CHANGES pyparsing/helpers.py pyparsing/testing.py tests/test_simple_unit.py tests/test_unit.py
95c5de2	0.089	Correct typos in White.whiteStrs definition (#172) pyparsing/core.py
1e4ea58	0.092	Remove unused Scrutinizer CI configuration (#149) .scrutinizer.yml scrutinizer-pyenv.sh
3c6afc4	0.092	Include 2.4.x change notes to CHANGES; add select_parser to unit tests; minor changes to select_parser CHANGES examples/select_parser.py tests/test_examples.py
0b39806	0.089	Break up pyparsing.py monolith into sub-modules in a pyparsing package (#162) README.rst pyparsing/__init__.py pyparsing/actions.py pyparsing/common.py pyparsing/core.py pyparsing/exceptions.py pyparsing/helpers.py pyparsing/results.py pyparsing/testing.py pyparsing/unicode.py pyparsing/util.py pyparsing_archive.py setup.py
bea48a4	0.090	select_parser example: misc improvements (#157) examples/select_parser.py
094ffc8	0.093	Use assertRaises for tests that raise exceptions (#160) tests/test_unit.py
4899103	0.087	Use classmethod decorator (#159) tests/test_unit.py
6a39aa4	0.086	Use staticmethod decorator (#158) tests/test_unit.py
53d1b4a	0.091	Blacken the project (#141) .gitignore .travis.yml CONTRIBUTING.md docs/conf.py examples/LAparser.py examples/SimpleCalc.py examples/TAP.py examples/adventureEngine.py examples/antlr_grammar.py examples/antlr_grammar_tests.py examples/apicheck.py examples/bigquery_view_parser.py examples/booleansearchparser.py examples/btpyparse.py examples/builtin_parse_action_demo.py examples/cLibHeader.py examples/chemicalFormulas.py examples/commasep.py examples/configParse.py examples/cpp_enum_parser.py examples/datetimeParseActions.py examples/decaf_parser.py examples/delta_time.py examples/dfmparse.py examples/dhcpd_leases_parser.py examples/dictExample.py examples/dictExample2.py examples/ebnf.py examples/ebnftest.py examples/eval_arith.py examples/excelExpr.py examples/fourFn.py examples/gen_ctypes.py examples/getNTPserversNew.py examples/greeting.py examples/greetingInGreek.py examples/greetingInKorean.py examples/holaMundo.py examples/htmlStripper.py examples/htmlTableParser.py examples/httpServerLogParser.py examples/idlParse.py examples/include_preprocessor.py examples/indentedGrammarExample.py examples/invRegex.py examples/jsonParser.py examples/linenoExample.py examples/list1.py examples/listAllMatches.py examples/lucene_grammar.py examples/macroExpander.py examples/matchPreviousDemo.py examples/mozillaCalendarParser.py examples/nested.py examples/nested_markup.py examples/numerics.py examples/oc.py examples/parseListString.py examples/parsePythonValue.py examples/parseResultsSumExample.py examples/parseTabularData.py examples/partial_gene_match.py examples/pgn.py examples/position.py examples/protobuf_parser.py examples/pymicko.py examples/pythonGrammarParser.py examples/rangeCheck.py examples/readJson.py examples/removeLineBreaks.py examples/romanNumerals.py examples/rosettacode.py examples/scanExamples.py examples/searchParserAppDemo.py examples/searchparser.py examples/select_parser.py examples/sexpParser.py examples/shapes.py examples/simpleArith.py examples/simpleBool.py examples/simpleSQL.py examples/simpleWiki.py examples/sparser.py examples/sql2dot.py examples/stackish.py examples/statemachine/documentSignoffDemo.py examples/statemachine/documentsignoffstate.pystate examples/statemachine/libraryBookDemo.py examples/statemachine/statemachine.py examples/statemachine/vending_machine.py examples/statemachine/video_demo.py examples/test_bibparse.py examples/urlExtractor.py examples/urlExtractorNew.py examples/verilogParse.py examples/wordsToNum.py pyparsing.py setup.py tests/test_examples.py tests/test_simple_unit.py tests/test_unit.py tox.ini update_pyparsing_timestamp.py
41752aa	0.086	Some code header cleanup; remove BUFFER_OUTPUT from test_unit.py, and replace most resetting() context managers and try-finallys with ppt.reset_pyparsing_context tests/test_examples.py tests/test_simple_unit.py tests/test_unit.py
f73e257	0.090	Use pyupgrade to upgrade the code to use Python3 conventions (#138) docs/conf.py examples/TAP.py examples/adventureEngine.py examples/bigquery_view_parser.py examples/booleansearchparser.py examples/btpyparse.py examples/chemicalFormulas.py examples/dfmparse.py examples/eval_arith.py examples/gen_ctypes.py examples/getNTPserversNew.py examples/greetingInGreek.py examples/greetingInKorean.py examples/holaMundo.py examples/invRegex.py examples/linenoExample.py examples/nested.py examples/parsePythonValue.py examples/protobuf_parser.py examples/pymicko.py examples/pythonGrammarParser.py examples/rangeCheck.py examples/romanNumerals.py examples/searchparser.py examples/sexpParser.py examples/shapes.py examples/simpleBool.py examples/simpleWiki.py examples/sparser.py examples/statemachine/libraryBookDemo.py examples/statemachine/statemachine.py examples/statemachine/trafficLightDemo.py examples/statemachine/vending_machine.py examples/verilogParse.py tests/test_simple_unit.py tests/test_unit.py
6968080	0.089	remove ide files (#152) .idea/inspectionProfiles/Project_Default.xml .idea/misc.xml .idea/modules.xml .idea/pyparsing.iml .idea/vcs.xml
9e1fbe3	0.090	Remove unused setup.py keywords test_suite (#137) CHANGES MANIFEST.in setup.py
6fd91c3	0.088	Fix tox to run refactored tests (#151) .travis.yml tox.ini
df028ea	0.090	Remove deprecated license_file from setup.cfg (#146) setup.cfg
c4499b3	0.089	Stop install tox within the tox environment (#150) tox.ini
3481b6f	0.086	refactor tests into tests directory (#130) .gitignore .scrutinizer.yml .travis.yml MANIFEST.in pyparsing.py setup.py tests/__init__.py tests/json_parser_tests.py tests/karthik.ini tests/parsefiletest_input_file.txt tests/requirements.txt tests/test_examples.py tests/test_simple_unit.py tests/test_unit.py tox.ini
87d14e7	0.088	Py3 cleanup: Remove workaround for Python2 urllib (#143) examples/getNTPserversNew.py examples/statemachine/statemachine.py
69aea39	0.088	Remove unused imports (#147) examples/SimpleCalc.py examples/fourFn.py examples/htmlStripper.py examples/protobuf_parser.py examples/sexpParser.py examples/simpleSQL.py examples/urlExtractorNew.py pyparsing.py unitTests.py
b268114	0.088	Py3 cleanup: Remove workaround from Python3 unichr() (#144) examples/booleansearchparser.py
fd8252e	0.092	Py3 cleanup: Remove use of closing() with urlopen() (#145) examples/getNTPserversNew.py examples/htmlStripper.py examples/partial_gene_match.py examples/urlExtractor.py examples/urlExtractorNew.py
4e1a557	0.086	Py3 cleanup: Remove unnecessary __ne__ method (#140) examples/btpyparse.py pyparsing.py
6fcd838	0.086	Py3 cleanup: Remove __nonzero__ method (#142) examples/simpleBool.py
8396c6d	0.087	Remove universal = 1 from [bdist_wheel] section of setup.cfg (#139) setup.cfg
9264f80	0.087	Add missing trove classifiers to setup.py (#136) setup.py
b67b510	0.086	Add Python 3.8 to the tox matrix (#135) tox.ini
3fcb97e	0.090	Remove unnecessary keys and overrides from Travis (#134) .travis.yml
ccf26a3	0.092	Support building without setuptools (#133) setup.py
719c9a5	0.093	Add support for dynamic overwrite of
4173326	0.090	Fix PrecededBy bug, issue #127 CHANGES pyparsing.py unitTests.py
6ee198c	0.089	Merge remote-tracking branch origin/master
0029d02	0.089	Merge unittest enhancements from branch .idea/inspectionProfiles/Project_Default.xml CHANGES pyparsing.py simple_unit_tests.py tox.ini unitTests.py
3e5b266	0.049	Merge remote-tracking branch origin/master
a3c11d6	0.047	More Py2->Py3 cleanup, roll forward fix to ParserElement.__eq__ pyparsing.py unitTests.py
8701699	0.044	Fix simple typo: pyaprsing -> pyparsing (#121) CONTRIBUTING.md
cbb1d29	0.047	More codecov changes .travis.yml
c3660c7	0.046	Add links to codecov and codecov badge to README README.rst
418f036	0.045	Add long_description for setup.py; add py3.8-dev and pypy3 to Travis CI versions .travis.yml setup.py
29764eb	0.045	Update version timestamp pyparsing.py
8339b04	0.046	Propagate setDefaultWhitespaceChars to helper expressions defined in pyparsing module CHANGES pyparsing.py unitTests.py
6a899ff	0.045	Fixed bug when ZeroOrMore parses no matching exprs, did not include a named result containing [] CHANGES pyparsing.py unitTests.py
84a1245	0.047	Merge remote-tracking branch origin/master
0369973	0.045	Make next release 3.0.0 instead of 2.5.0 to reflect Py3-only; fix warning message; minor improvement when default literal string class is other than Literal; always add extra newline after dump() CHANGES pyparsing.py
99ea242	0.046	Fix minor bug in creating regex range for single character; add unit tests pyparsing.py unitTests.py
072f0dd	0.045	Add regex range collapsing to compress large character ranges for faster re performance; update CHANGES to reflect new booleansearchparser example CHANGES pyparsing.py
d5c036d	0.047	Minor unit test cleanups unitTests.py
92e79f0	0.047	Update contribution guidelines CONTRIBUTING.md
e909715	0.047	Add Py2 compat code at
8b8cf2c	0.048	Add .DS_Store to .gitignore (#115) .gitignore
709030d	0.047	Boolean Search query parser: allows to perform searches with the common boolean search syntax against a text (#21) examples/booleansearchparser.py
4ff075c	0.045	Update example to proto3 syntax (#113) examples/protobuf_parser.py
2c6f881	0.046	3.x-ify some print statements and an except (#114) docs/HowToUsePyparsing.rst
e115e88	0.045	More Py2 compatibility scrubbing in unit tests, and migration ZeroOrMore to [...] notation unitTests.py
781a39c	0.046	Remove Py2 compatibility code from unit tests simple_unit_tests.py unitTests.py
675e87a	0.046	Rework __diag__ and __compat__ to be actual classes instead of just namespaces, to add helpful behavior and methods CHANGES pyparsing.py unitTests.py
7c1db54	0.045	Fixed bug in indentedBlock with a parser using two different types of nested indented blocks with different indent values, but sharing the same indent stack. Raised in comments on #87. pyparsing.py unitTests.py
c02db74	0.046	Typo and spelling cleanup, add helpful comments examples/partial_gene_match.py
123e830	0.045	Fixed bug in CloseMatch where end location was incorrectly computed; and updated partial_gene_match.py example. CHANGES examples/partial_gene_match.py pyparsing.py
9ca5931	0.045	Code style updates; remove deprecated methods examples/romanNumerals.py examples/rosettacode.py examples/shapes.py
10b5e96	0.046	Remove deprecated methods and names; disabled __compat__.collect_all_And_tokens; correct doctests; more minor whitespace cleanup CHANGES pyparsing.py unitTests.py
c45813f	0.046	First pass removing Py2 cross-compatibility features .travis.yml CHANGES pyparsing.py setup.py unitTests.py
897e536	0.046	Improved handling of -
b0f76d8	0.046	Example BigQuery view SQL parser (#112) examples/bigquery_view_parser.py
e0db26b	0.046	fourFn.py updates - handle leading + and - unary signs for parenthesized expressions; and real numbers with no leading digit before the decimal examples/fourFn.py unitTests.py
36aa91c	0.045	Update fourFn.py to handle functions that take multiple args, and nested functions examples/SimpleCalc.py examples/fourFn.py unitTests.py
b9c11d7	0.046	Typo and whitespace cleanup docs/HowToUsePyparsing.rst unitTests.py
6248dc0	0.046	Merge pull request #108 from cngkaygusuz/word-doc pyparsing.py
bc531f1	0.048	Include new files filetypes and dirs in MANIFEST.in MANIFEST.in
a94746d	0.047	Update README to include links to online docs - also remove numerous special characters, smart quotes, etc. for cleaner cross-platform presentation. See Issue #109 README.rst
310639e	0.047	Updates to prep for 2.4.2 release CHANGES README.rst docs/HowToUsePyparsing.rst pyparsing.py
8d6a132	0.047	Fold in 2.4.1.1 blurb from 2.4.1.x branch, describing known issues in 2.4.1.1 CHANGES
1c1405d	0.047	Add unit test for #103; also make CHANGES blurb and HowToUse notes a little clearer CHANGES docs/HowToUsePyparsing.rst unitTests.py
7eb54f0	0.045	More accurate description of bugs and their respective fixes CHANGES
c1a136d	0.046	Fixed faux iteration behavior implicit with using __getitem__, found while investigating and resolving issue #103 pyparsing.py
9f9ec78	0.047	Merge branch pyparsing_2.4.x
1363860	0.046	Update version in prep for new 2.5.x work pyparsing.py

@asottile
Copy link
Contributor Author

asottile commented Feb 5, 2022

I took at stab at it in #363

I could probably do some more perf analysis to shave off some more time -- but this gets it back to ~66ms on my machine

@ptmcg ptmcg closed this as completed in #363 Feb 6, 2022
ptmcg added a commit that referenced this issue Feb 6, 2022
ptmcg added a commit that referenced this issue Feb 6, 2022
@ptmcg
Copy link
Member

ptmcg commented Feb 6, 2022

Fixed a bad unit test that turned up a bug in raising ValueError - made minor fixes in a follow-up commit.

@ptmcg
Copy link
Member

ptmcg commented Feb 6, 2022

Any other optimizations would be very welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants