Repository navigation
Read the value type of an enum's members from the enum class - #6160
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will improve performance by 55.18%2 warnings
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
Breaking Change AnalysisResult: No breaking changes detected Reasoning: This PR is an internal refactor. It adds one helper in model/enum.py, enum_value_base, with an EnumValueBaseRow alias, and that helper now decides which builtin type an enum's members are instances of. It replaces the private _base_value_type, _SPECIALIZED_VALUE_BASES and _members_equal_values, and the inline IntEnum and StrEnum isinstance checks in _all_of_values.py, _passes/imports.py, _passes/modules.py and _tag_plan.py. The merged-enum call sites use the legacy-merged-enum-specialized-only row, which returns int for IntEnum, str for StrEnum and None otherwise, exactly as the old inline code did. Enum.value_base gives the same results as before: IntEnum and StrEnum map to int and str, and a use-subclass-enum builtin base maps to its type. The msgspec mixed-enum and wide-int warnings and the discriminator member-key check give the same answers for the enum kinds the generator writes. Only private names were removed. No CLI options, templates, defaults, Python version support or error reporting changed, and the docs files only gained new table rows. The behaviour diff gate compares the whole PR tier against the last release. Its accepted cells cover discriminator mapping paths, modules named annotations, integer constraints past 2 to the 53, prefixItems and JSON pointer handling, and none of the code paths behind them are touched by this diff, so they come from other PRs and are not attributed to this one. This analysis was produced by the release draft workflow |
Summary by CodeRabbit