Skip to content

fix: Preserve standalone named expression parentheses - #488

Open
lprnmns wants to merge 1 commit into
mkdocstrings:mainfrom
lprnmns:codex/fix-standalone-walrus-parentheses
Open

fix: Preserve standalone named expression parentheses#488
lprnmns wants to merge 1 commit 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
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