PyO3 / PyO3/pyo3

`enum`s generated by Pyo3 don't actually subclass Python's `Enum`

Open
#2,887 9 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
16.2k
Forks
1k
Avg merge
2d 6h
Merged PRs (30d)
66

Description

enums generated by Pyo3 don't actually subclass Python's Enum. Due to this, some attributes/methods are missing from Pyo3 enums that you would expect in Python. Additionally, EnumType is not the metaclass of Pyo3 enums leading to the same problems.

I am not entirely sure how this might be fixed, simply because I don't know the restrictions of the Python C API.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by tracing how PyO3 generates enums and reviewing Python's Enum and EnumType behavior alongside the Python C API constraints; done means PyO3 enums provide the expected attributes and use EnumType as their metaclass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.