Skip to content

fix: Preserve standalone named expression parentheses - #488

Merged
pawamoy merged 3 commits into
mkdocstrings:mainfrom
lprnmns:codex/fix-standalone-walrus-parentheses
Oct 16, 2026
Merged

pawamoy merged 3 commits into
mkdocstrings:mainfrom
lprnmns:codex/fix-standalone-walrus-parentheses

Conversation

@lprnmns

@lprnmns lprnmns commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

For reviewers

  • I did not use AI
  • I used AI and thoroughly reviewed every code/docs change

Description of the change

Preserve the required parentheses when a named expression is rendered on its own. Previously, (value := 1) became value := 1, which cannot be parsed as an expression.

Nested named expressions keep using the existing context-aware renderer, so their output is unchanged.

Relevant resources

  • Reproduced independently on the current main branch.
  • PYTHON_VERSIONS='' ./scripts/make check test
  • .venv/bin/python -m pytest packages/griffelib/tests/test_expressions.py -q — 918 passed, 16 skipped

@pawamoy

pawamoy commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

Follow-up of #480.

@lprnmns
lprnmns marked this pull request as ready for review September 3, 2026 10:58
@pawamoy
pawamoy force-pushed the codex/fix-standalone-walrus-parentheses branch from bef6f7e to 0f75dbb Compare October 16, 2026 16:20
@pawamoy
pawamoy merged commit dc6300d into mkdocstrings:main Oct 16, 2026
10 checks passed
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.

2 participants