6 comments (6 comments)4 reactions (4 reactions)0 assignees (0 assignees)C++2,005 forks (2,005 forks)batch import
bugenhancementhelp wanted
Repository metrics
- Stars
- 14,677 stars (14,677 stars)
- PR merge metrics
- Avg merge 5d 2h (Avg merge 5d 2h)10 merged PRs in 30d (10 merged PRs in 30d)
Description
Currently enums compare equal with == but not with is.
I think it would be good if enums would be singletons like None instead.
Contributor guide
- Research direction
- Implement singleton behavior for enums in pybind11 by overriding the new method to cache instances and ensure that each enum value is created only once, similar to Python's None singleton.
- Tech stack
- cpython
- Domain
- backend
- Issue type
- Feature
- Prerequisites
- PythonC++