Skip to content

fix __qualname__ for complex enum variants#5796

Merged
davidhewitt merged 3 commits intoPyO3:mainfrom
davidhewitt:complex-enum-qualname
Feb 12, 2026
Merged

fix __qualname__ for complex enum variants#5796
davidhewitt merged 3 commits intoPyO3:mainfrom
davidhewitt:complex-enum-qualname

Conversation

@davidhewitt
Copy link
Member

Closes #5788

This adds a __qualname__ field to the generated complex enum variant classes.

It might be nice to eventually refactor the macros to do this without so much boilerplate. This'll do for shipping 0.28.1.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 12, 2026

Merging this PR will improve performance by 18.8%

⚡ 1 improved benchmark
✅ 98 untouched benchmarks
⏩ 1 skipped benchmark1

Performance Changes

Benchmark BASE HEAD Efficiency
format_simple 368.6 ns 310.3 ns +18.8%

Comparing davidhewitt:complex-enum-qualname (07243dd) with main (5338c48)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@davidhewitt davidhewitt added this pull request to the merge queue Feb 12, 2026
Merged via the queue into PyO3:main with commit 4e81116 Feb 12, 2026
43 of 44 checks passed
@davidhewitt davidhewitt deleted the complex-enum-qualname branch February 12, 2026 20:45
davidhewitt added a commit that referenced this pull request Feb 13, 2026
* fix `__qualname__` for complex enum variants

* newsfragment

* clippy
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.

Namespace change for Enum pickling in 0.28

2 participants