Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pyparsing 3.2.2

Choose a tag to compare

@ptmcgptmcg released this 24 Mar 04:32
· 197 commits to master since this release

The upcoming version 3.3.0 release will begin emittingDeprecationWarnings for pyparsing methods that have been renamed to PEP8-compliant names (introduced in pyparsing 3.0.0, in August, 2021, with legacy names retained as aliases). In preparation, I have added in pyparsing 3.2.2 a utility for finding and replacing the legacy method names with the new names. This utility is located atpyparsing/tools/cvt_pep8_names.py. This script will scan all Python files specified on the command line, and if the-u option is selected, will replace all occurrences of the old method names with the new PEP8-compliant names, updating the files in place.

Here is an example that converts all the files in the pyparsing/examples directory:

  python -m pyparsing.tools.cvt_pyparsing_pep8_names -u examples/*.py

The new names are compatible with pyparsing versions 3.0.0 and later.


  • Releasedcvt_pyparsing_pep8_names.py conversion utility to upgrade pyparsing-based programs and libraries that use legacy camelCase names to use the new PEP8-compliant snake_case method names. The converter can also be imported into other scripts as

      from pyparsing.tools.cvt_pyparsing_pep8_names import pep8_converter
  • Fixed bug innested_expr where nested contents were stripped of whitespace when the default whitespace characters were cleared (raised in this StackOverflow questionhttps://stackoverflow.com/questions/79327649 by Ben Alan). Also addressed bug in resolving PEP8 compliant argument name and legacy argument name.

  • Fixed bug inrest_of_line and the underlyingRegex class, in which matching a pattern that could match an empty string (such as".*" or"[A-Z]*" would not raise aParseException at or beyond the end of the input string. This could cause an infinite parsing loop when parsingrest_of_line at the end of the input string. Reported by user Kylotan, thanks! (Issue#593)

  • Enhancements and extra input validation forpyparsing.util.make_compressed_re - see usage inexamples/complex_chemical_formulas.py and result in the generated railroad diagramexamples/complex_chemical_formulas_diagram.html. Properly escapes characters like "." and "*" that have special meaning in regular expressions.

  • Fixed bug inone_of() to properly escape characters that are regular expression markers (such as '*', '+', '?', etc.) before building the internal regex.

  • Better exception message forMatchFirst andOr expressions, showing all alternatives rather than just the first one. Fixes Issue#592, reported by Focke, thanks!

  • Added return type annotation of "-> None" for all__init__() methods, to satisfymypy --strict type checking. PR submitted by FeRD, thank you!

  • Added optional argumentshow_hidden tocreate_diagram to show elements that are used internally by pyparsing, but are not part of the actual parser grammar. For instance, theTag class can insert values into the parsed results but it does not actually parse any input, so by default it is not included in a railroad diagram. By callingcreate_diagram withshow_hidden =True, these internal elements will be included. (You can see this in the tag_metadata.py script in the examples directory.)

  • Fixed bug innumber_words.py example. Also addedebnf_number_words.py to demonstrate using theebnf.py EBNF parser generator to build a similar parser directly from EBNF.

  • Fixed syntax warning raised inbigquery_view_parser.py, invalid escape sequence "\s". Reported by sameer-google, nice catch! (Issue#598)

  • Added support for Python 3.14.

Assets4
Loading
MajorTanya reacted with hooray emoji
1 person reacted

[8]ページ先頭

©2009-2025 Movatter.jp