1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! # pyenum
//!
//! Expose Rust `enum` types to Python as genuine `enum.Enum` subclasses via
//! PyO3 — `#[derive(PyEnum)]`, functional-API class construction, a
//! per-interpreter cache, and `IntoPyObject` / `FromPyObject` conversion
//! plumbing generated by the derive.
//!
//! ## Scope
//!
//! * Unit-variant enums only; tuple / struct / generic / lifetime-parameterised
//! enums are rejected at compile time.
//! * Five Python enum bases are selectable: `Enum` (default), `IntEnum`,
//! `StrEnum`, `Flag`, `IntFlag`.
//! * Rust variant names are passed through unchanged (Python member name ==
//! Rust identifier).
//! * The Python class is constructed exactly once per interpreter and cached
//! via `pyo3::sync::PyOnceLock`.
//! * PyO3 0.28, CPython 3.11+.
//! * Free-threaded (`--disable-gil`) Python, module reload, and sub-interpreter
//! finalisation are out of scope.
pub use PyEnum;
pub use ;
pub use ;
/// Implementation detail — referenced by the output of `#[derive(PyEnum)]`.
///
/// Consumers MUST NOT import anything from this module directly; its shape is
/// allowed to change between patch releases without warning.