Skip to content

Clean up legacy Python <3.8 ast.Str deprecation in parser.py - #692

Open
ivegotahunnitonit wants to merge 1 commit into
google:masterfrom
ivegotahunnitonit:clean-ast-str-deprecation
Open

Clean up legacy Python <3.8 ast.Str deprecation in parser.py#692
ivegotahunnitonit wants to merge 1 commit into
google:masterfrom
ivegotahunnitonit:clean-ast-str-deprecation

Conversation

@ivegotahunnitonit

Copy link
Copy Markdown

Problem

In fire/parser.py, _StrNode maintained a fallback to ast.Str for Python < 3.8. In Python 3.14+, ast.Str has been fully removed from the standard library ast module, leaving deprecated references and pylint suppressions in the codebase.

Solution

  • Modernize _StrNode to directly use standard ast.Constant across supported Python versions (3.8+ through 3.14).
  • Ensure clean instantiation of ast.Constant(value=value) with explicit keyword mapping for robust cross-version AST evaluation.
  • Remove obsolete pylint: disable=no-member and deprecated legacy type ignores.

Verification

  • Tested across Python 3.8, 3.10, 3.12, 3.13, and 3.14.
  • All parser unit tests pass with zero deprecation warnings.

@google-cla

google-cla Bot commented Aug 14, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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 this pull request may close these issues.

1 participant