Skip to content

docs: clarify enum string representation - #504

Merged
pawamoy merged 4 commits into
mkdocstrings:mainfrom
sean0407:codex/docs-enum-str-20261016
Oct 16, 2026
Merged

pawamoy merged 4 commits into
mkdocstrings:mainfrom
sean0407:codex/docs-enum-str-20261016

Conversation

@sean0407

Copy link
Copy Markdown
Contributor

For reviewers

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

Summary

The 2.3.1 switch to StrEnum changed str(member) to return its value.

- str(ParameterKind.var_keyword) -> "ParameterKind.var_keyword"
+ str(ParameterKind.var_keyword) -> "variadic keyword"
+ ParameterKind.var_keyword.name -> "var_keyword"

Evidence

  • Before: The 2.3.1 changelog mentions Python 3.10 support removal, and the ParameterKind API reference does not explain str().
  • After: The changelog and API reference document that str(member) returns its value while .name returns the member name.
  • Validation: git diff --check and a standard-library StrEnum behavior probe passed.

Description of the change

Users comparing or logging enum strings now have a release note and API reference describing the 2.3.1 behavior change.

Relevant resources

Merge Danger

Door: two-way

Blast Radius: documentation

Issue-501: #501

@pawamoy

pawamoy commented Oct 16, 2026

Copy link
Copy Markdown
Member

Thanks for the PR. Lets document that the string representation of enumeration values is not part of the public API. This can be written in packages/griffelib/src/griffe/__init__.py. We can note that the name and value attributes of enumeration values are public, and that their values are stable.

Then in the changelog, we can remove the "breaking changes" section and instead add a short sentence after <small>. Can you take care of this @sean0407 🙂?

@pawamoy pawamoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets remove some of it. I'll apply the suggestions.

Comment thread CHANGELOG.md Resolved
Comment thread docs/reference/api/models/function.md Resolved

@pawamoy pawamoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again!

@pawamoy
pawamoy merged commit 4701aa5 into mkdocstrings:main Oct 16, 2026
1 check 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