Library of Assembled Shared Sources
Enum Definitions

Detailed Description

Defining first-class enum types in Python from C++ enums.

This module provides helper macros and classes to define Python enum types that derive from enum.Enum, enum.IntEnum, enum.StrEnum or enum.IntFlag.

Python Enum Types

The following Python enum types can be created:

Usage Overview

To export a C++ enum to Python, you need 3 macros:

  1. One PY_SHADOW_* macro in the header file to specialize PyExportTraits
  2. One PY_DECLARE_* macro in the source file to define the enum mapping
  3. One PY_MODULE_ENUM() or PY_CLASS_ENUM() macro to add the enum to a module or class

Once defined, the enum can be used as parameters or return types in function signatures, as class members, etc. The header defining PY_SHADOW_* must be included in source files that export these functions to Python, or add the enum to a module or class.

For enum.IntEnum (most common case):

// In header:
PY_SHADOW_INT_ENUM(LASS_DLL_EXPORT, MyEnum);
// In source:
PY_DECLARE_INT_ENUM_EX(MyEnum)("MyEnum", "MyEnum documentation", {
{ "VALUE1", MyEnum::Value1 },
{ "VALUE2", MyEnum::Value2 },
});
// Add to module or class:
PY_MODULE_ENUM(mymodule, MyEnum); // or PY_CLASS_ENUM(MyClass, MyEnum);
#define PY_DECLARE_INT_ENUM_EX(t_cppEnum)
Defines the enumDefinition for initialization with constructor arguments for enum....
#define PY_MODULE_ENUM(i_module, t_cppEnum)
Adds an enum definition to a Python module.
#define PY_SHADOW_INT_ENUM(dllInterface, t_cppEnum)
Specializes PyExportTraits for a C++ enum using enum.IntEnum.

For enum.StrEnum (string-based enums):

// In header:
PY_SHADOW_STR_ENUM(LASS_DLL_EXPORT, Shape);
// In source:
PY_DECLARE_STR_ENUM_EX(Shape)("Shape", "Shape documentation", {
{ "CIRCLE", Shape::Circle, "circle" },
{ "SQUARE", Shape::Square, "square" },
});
// Add to module or class:
PY_MODULE_ENUM(mymodule, Shape); // or PY_CLASS_ENUM(MyClass, Shape);
#define PY_DECLARE_STR_ENUM_EX(t_cppEnum)
Defines the enumDefinition for initialization with constructor arguments for enum....
#define PY_SHADOW_STR_ENUM(dllInterface, t_cppEnum)
Specializes PyExportTraits for a C++ enum using enum.StrEnum.

For enum.IntFlag (bitfield enums):

// In header:
PY_SHADOW_INT_FLAG(LASS_DLL_EXPORT, Breakfast);
// In source:
PY_DECLARE_INT_FLAG_EX(Breakfast)("Breakfast", "Breakfast documentation", FlagBoundary::Keep, {
{ "EGG", Breakfast::Egg },
{ "BACON", Breakfast::Bacon },
{ "ALL", Breakfast::All },
});
// Add to module or class:
PY_MODULE_ENUM(mymodule, Breakfast); // or PY_CLASS_ENUM(MyClass, Breakfast);
#define PY_SHADOW_INT_FLAG(dllInterface, t_cppEnum)
Specializes PyExportTraits for a C++ enum using enum.IntFlag.
#define PY_DECLARE_INT_FLAG_EX(t_cppEnum)
Defines the enumDefinition for initialization with constructor arguments for enum....
@ Keep
Allow any integer value (most permissive)

For enum.Enum (generic enums):

// In header:
using WeekdayPair = std::pair<int, std::string>;
PY_SHADOW_ENUM(LASS_DLL_EXPORT, Weekday, WeekdayPair)
// In source:
PY_DECLARE_ENUM_EX(Weekday, WeekdayPair)("Weekday", "Weekday documentation", {
{ "MONDAY", Weekday::Monday, std::make_pair(Weekday::Monday, "Monday") },
{ "TUESDAY", Weekday::Tuesday, std::make_pair(Weekday::Tuesday, "Tuesday") },
});
// Add to module or class:
PY_MODULE_ENUM(mymodule, Weekday); // or PY_CLASS_ENUM(MyClass, Weekday);
#define PY_SHADOW_ENUM(dllInterface, t_cppEnum, t_valueType)
Specializes PyExportTraits for a C++ enum using generic enum.Enum.
#define PY_DECLARE_ENUM_EX(t_cppEnum, t_valueType)
Defines the enumDefinition for initialization with constructor arguments for generic enum....

Data Structures

class  lass::python::EnumDefinitionBase
 Base class of all enum definitions. More...
 
class  lass::python::IntEnumDefinition< EnumType >
 Definition of an enum.IntEnum-derived enum type in Python. More...
 
class  lass::python::IntFlagDefinition< EnumType >
 Definition of an enum.IntFlag-derived enum type in Python. More...
 
class  lass::python::EnumDefinition< EnumType, ValueType >
 Definition of a general enum.Enum-derived enum type in Python. More...
 
class  lass::python::StrEnumDefinition< EnumType, ValueType >
 Definition of an enum.StrEnum-derived enum type in Python. More...
 

Enumerations

enum class  lass::python::FlagBoundary { lass::python::FlagBoundary::Keep , lass::python::FlagBoundary::Strict , lass::python::FlagBoundary::Conform }
 Defines the boundary behavior for enum.IntFlag-derived enums. More...
 

Functions

TPyObjPtr lass::python::impl::makeEnumType (const char *name, TPyObjPtr &&enumerators, TPyObjPtr &&kwargs)
 Creates a basic enum.Enum type.
 
TPyObjPtr lass::python::impl::makeIntEnumType (const char *name, TPyObjPtr &&enumerators, TPyObjPtr &&kwargs)
 Creates an enum.IntEnum type.
 
TPyObjPtr lass::python::impl::makeIntFlagType (const char *name, TPyObjPtr &&enumerators, TPyObjPtr &&kwargs, FlagBoundary boundary=FlagBoundary::Keep)
 Creates an enum.IntFlag type.
 
TPyObjPtr lass::python::impl::makeStrEnumType (const char *name, TPyObjPtr &&enumerators, TPyObjPtr &&kwargs)
 Creates an enum.StrEnum type (or equivalent for Python < 3.11).
 

Integer Enum Support

Macros for exporting C++ integer enums as Python enum.IntEnum types.

#define PY_SHADOW_INT_ENUM(dllInterface, t_cppEnum)
 Specializes PyExportTraits for a C++ enum using enum.IntEnum.
 
#define PY_DECLARE_INT_ENUM_NAME(t_cppEnum, s_name)
 Defines the enumDefinition with name only for enum.IntEnum.
 
#define PY_DECLARE_INT_ENUM_NAME_DOC(t_cppEnum, s_name, s_doc)
 Defines the enumDefinition with name and docstring for enum.IntEnum.
 
#define PY_DECLARE_INT_ENUM_EX(t_cppEnum)
 Defines the enumDefinition for initialization with constructor arguments for enum.IntEnum.
 

Integer Flag Support

Macros for exporting C++ flag enums as Python enum.IntFlag types with bitwise operations.

#define PY_SHADOW_INT_FLAG(dllInterface, t_cppEnum)
 Specializes PyExportTraits for a C++ enum using enum.IntFlag.
 
#define PY_DECLARE_INT_FLAG_NAME(t_cppEnum, s_name)
 Defines the enumDefinition with name only for enum.IntFlag.
 
#define PY_DECLARE_INT_FLAG_NAME_DOC(t_cppEnum, s_name, s_doc)
 Defines the enumDefinition with name and docstring for enum.IntFlag.
 
#define PY_DECLARE_INT_FLAG_EX(t_cppEnum)
 Defines the enumDefinition for initialization with constructor arguments for enum.IntFlag.
 

Generic Enum Support

Macros for exporting C++ enums as Python enum.Enum types with custom value types.

#define PY_SHADOW_ENUM(dllInterface, t_cppEnum, t_valueType)
 Specializes PyExportTraits for a C++ enum using generic enum.Enum.
 
#define PY_DECLARE_ENUM_NAME(t_cppEnum, t_valueType, s_name)
 Defines the enumDefinition with name only for generic enum.Enum.
 
#define PY_DECLARE_ENUM_NAME_DOC(t_cppEnum, t_valueType, s_name, s_doc)
 Defines the enumDefinition with name and docstring for generic enum.Enum.
 
#define PY_DECLARE_ENUM_EX(t_cppEnum, t_valueType)
 Defines the enumDefinition for initialization with constructor arguments for generic enum.Enum.
 

String Enum Support

Macros for exporting C++ enums as Python enum.StrEnum types with string values.

#define PY_SHADOW_STR_ENUM(dllInterface, t_cppEnum)
 Specializes PyExportTraits for a C++ enum using enum.StrEnum.
 
#define PY_DECLARE_STR_ENUM_NAME(t_cppEnum, s_name)
 Defines the enumDefinition with name only for enum.StrEnum.
 
#define PY_DECLARE_STR_ENUM_NAME_DOC(t_cppEnum, s_name, s_doc)
 Defines the enumDefinition with name and docstring for enum.StrEnum.
 
#define PY_DECLARE_STR_ENUM_EX(t_cppEnum)
 Defines the enumDefinition for initialization with constructor arguments for enum.StrEnum.
 

Common Enum Utilities

Utility macros for adding enum definitions to modules and classes.

#define PY_MODULE_ENUM(i_module, t_cppEnum)
 Adds an enum definition to a Python module.
 
#define PY_CLASS_ENUM(i_cppClass, t_cppEnum)
 Adds an enum definition as a nested enum to a Python class.
 

Macro Definition Documentation

◆ PY_SHADOW_INT_ENUM

#define PY_SHADOW_INT_ENUM ( dllInterface,
t_cppEnum )
Value:
namespace lass \
{ \
namespace python \
{ \
template <> \
struct PyExportTraits<t_cppEnum> \
{ \
using TEnum = t_cppEnum; \
using TEnumDefinition = IntEnumDefinition<TEnum>; \
static dllInterface TEnumDefinition enumDefinition; \
static PyObject* build(TEnum value) { return enumDefinition.build(value); } \
static int get(PyObject* obj, TEnum& value) { return enumDefinition.get(obj, value); } \
}; \
} \
} \
Library for Assembled Shared Sources.
Definition config.h:53

Specializes PyExportTraits for a C++ enum using enum.IntEnum.

Use this in header files, then use PY_DECLARE_INT_ENUM_* in source files.

Parameters
dllInterfaceExport specification (e.g., LASS_DLL_EXPORT)
t_cppEnumC++ enum type
See also
lass::python::IntEnumDefinition

Definition at line 846 of file enum_definition.h.

◆ PY_DECLARE_INT_ENUM_NAME

#define PY_DECLARE_INT_ENUM_NAME ( t_cppEnum,
s_name )
Value:
Definition of an enum.IntEnum-derived enum type in Python.
by copy, general case assumes shadow type or PyObjectPlus based type.

Defines the enumDefinition with name only for enum.IntEnum.

Parameters
t_cppEnumC++ enum type
s_namePython enum name (const char* string with static storage duration)
See also
lass::python::IntEnumDefinition

Definition at line 870 of file enum_definition.h.

◆ PY_DECLARE_INT_ENUM_NAME_DOC

#define PY_DECLARE_INT_ENUM_NAME_DOC ( t_cppEnum,
s_name,
s_doc )
Value:

Defines the enumDefinition with name and docstring for enum.IntEnum.

Parameters
t_cppEnumC++ enum type
s_namePython enum name (const char* string with static storage duration)
s_docDocumentation string (const char* string with static storage duration, or nullptr)
See also
lass::python::IntEnumDefinition

Definition at line 880 of file enum_definition.h.

◆ PY_DECLARE_INT_ENUM_EX

#define PY_DECLARE_INT_ENUM_EX ( t_cppEnum)
Value:

Defines the enumDefinition for initialization with constructor arguments for enum.IntEnum.

Use this with initializer list: PY_DECLARE_INT_ENUM_EX(MyEnum)("MyEnum", "docs", { ... });

Parameters
t_cppEnumC++ enum type
See also
lass::python::IntEnumDefinition

Definition at line 889 of file enum_definition.h.

◆ PY_SHADOW_INT_FLAG

#define PY_SHADOW_INT_FLAG ( dllInterface,
t_cppEnum )
Value:
namespace lass \
{ \
namespace python \
{ \
template <> \
struct PyExportTraits<t_cppEnum> \
{ \
using TEnum = t_cppEnum; \
using TEnumDefinition = IntFlagDefinition<TEnum>; \
static dllInterface TEnumDefinition enumDefinition; \
static PyObject* build(TEnum value) { return enumDefinition.build(value); } \
static int get(PyObject* obj, TEnum& value) { return enumDefinition.get(obj, value); } \
}; \
} \
} \

Specializes PyExportTraits for a C++ enum using enum.IntFlag.

Use this in header files for bitfield enums, then use PY_DECLARE_INT_FLAG_* in source files.

Parameters
dllInterfaceExport specification (e.g., LASS_DLL_EXPORT)
t_cppEnumC++ enum type (should be a bitfield enum)
See also
lass::python::IntFlagDefinition
lass::python::FlagBoundary

Definition at line 910 of file enum_definition.h.

◆ PY_DECLARE_INT_FLAG_NAME

#define PY_DECLARE_INT_FLAG_NAME ( t_cppEnum,
s_name )
Value:

Defines the enumDefinition with name only for enum.IntFlag.

Parameters
t_cppEnumC++ enum type
s_namePython enum name (const char* string with static storage duration)
See also
lass::python::IntFlagDefinition

Definition at line 934 of file enum_definition.h.

◆ PY_DECLARE_INT_FLAG_NAME_DOC

#define PY_DECLARE_INT_FLAG_NAME_DOC ( t_cppEnum,
s_name,
s_doc )
Value:

Defines the enumDefinition with name and docstring for enum.IntFlag.

Parameters
t_cppEnumC++ enum type
s_namePython enum name (const char* string with static storage duration)
s_docDocumentation string (const char* string with static storage duration, or nullptr)
See also
lass::python::IntFlagDefinition

Definition at line 944 of file enum_definition.h.

◆ PY_DECLARE_INT_FLAG_EX

#define PY_DECLARE_INT_FLAG_EX ( t_cppEnum)
Value:

Defines the enumDefinition for initialization with constructor arguments for enum.IntFlag.

Use with: PY_DECLARE_INT_FLAG_EX(MyEnum)("MyEnum", "docs", FlagBoundary::Keep, { ... });

Parameters
t_cppEnumC++ enum type
See also
lass::python::IntFlagDefinition
lass::python::FlagBoundary

Definition at line 954 of file enum_definition.h.

◆ PY_SHADOW_ENUM

#define PY_SHADOW_ENUM ( dllInterface,
t_cppEnum,
t_valueType )
Value:
namespace lass \
{ \
namespace python \
{ \
template <> \
struct PyExportTraits<t_cppEnum> \
{ \
using TEnum = t_cppEnum; \
using TEnumDefinition = EnumDefinition<TEnum, t_valueType>; \
static dllInterface TEnumDefinition enumDefinition; \
static PyObject* build(TEnum value) { return enumDefinition.build(value); } \
static int get(PyObject* obj, TEnum& value) { return enumDefinition.get(obj, value); } \
}; \
} \
} \

Specializes PyExportTraits for a C++ enum using generic enum.Enum.

Use this in header files for enums with custom value types, then use PY_DECLARE_ENUM_* in source files.

Parameters
dllInterfaceExport specification (e.g., LASS_DLL_EXPORT)
t_cppEnumC++ enum type
t_valueTypePython value type for enum values
See also
lass::python::EnumDefinition

Definition at line 975 of file enum_definition.h.

◆ PY_DECLARE_ENUM_NAME

#define PY_DECLARE_ENUM_NAME ( t_cppEnum,
t_valueType,
s_name )
Value:

Defines the enumDefinition with name only for generic enum.Enum.

Parameters
t_cppEnumC++ enum type
t_valueTypePython value type
s_namePython enum name (const char* string with static storage duration)
See also
lass::python::EnumDefinition

Definition at line 1000 of file enum_definition.h.

◆ PY_DECLARE_ENUM_NAME_DOC

#define PY_DECLARE_ENUM_NAME_DOC ( t_cppEnum,
t_valueType,
s_name,
s_doc )
Value:

Defines the enumDefinition with name and docstring for generic enum.Enum.

Parameters
t_cppEnumC++ enum type
t_valueTypePython value type
s_namePython enum name (const char* string with static storage duration)
s_docDocumentation string (const char* string with static storage duration, or nullptr)
See also
lass::python::EnumDefinition

Definition at line 1011 of file enum_definition.h.

◆ PY_DECLARE_ENUM_EX

#define PY_DECLARE_ENUM_EX ( t_cppEnum,
t_valueType )
Value:

Defines the enumDefinition for initialization with constructor arguments for generic enum.Enum.

Use with: PY_DECLARE_ENUM_EX(MyEnum, std::string)("MyEnum", "docs", { ... });

Parameters
t_cppEnumC++ enum type
t_valueTypePython value type
See also
lass::python::EnumDefinition

Definition at line 1021 of file enum_definition.h.

◆ PY_SHADOW_STR_ENUM

#define PY_SHADOW_STR_ENUM ( dllInterface,
t_cppEnum )
Value:
namespace lass \
{ \
namespace python \
{ \
template <> \
struct PyExportTraits<t_cppEnum> \
{ \
using TEnum = t_cppEnum; \
using TEnumDefinition = StrEnumDefinition<TEnum>; \
static dllInterface TEnumDefinition enumDefinition; \
static PyObject* build(TEnum value) { return enumDefinition.build(value); } \
static int get(PyObject* obj, TEnum& value) { return enumDefinition.get(obj, value); } \
}; \
} \
}

Specializes PyExportTraits for a C++ enum using enum.StrEnum.

Use this in header files for string-based enums, then use PY_DECLARE_STR_ENUM_* in source files.

Parameters
dllInterfaceExport specification (e.g., LASS_DLL_EXPORT)
t_cppEnumC++ enum type
See also
lass::python::StrEnumDefinition

Definition at line 1041 of file enum_definition.h.

◆ PY_DECLARE_STR_ENUM_NAME

#define PY_DECLARE_STR_ENUM_NAME ( t_cppEnum,
s_name )
Value:

Defines the enumDefinition with name only for enum.StrEnum.

Parameters
t_cppEnumC++ enum type
s_namePython enum name (const char* string with static storage duration)
See also
lass::python::StrEnumDefinition

Definition at line 1064 of file enum_definition.h.

◆ PY_DECLARE_STR_ENUM_NAME_DOC

#define PY_DECLARE_STR_ENUM_NAME_DOC ( t_cppEnum,
s_name,
s_doc )
Value:

Defines the enumDefinition with name and docstring for enum.StrEnum.

Parameters
t_cppEnumC++ enum type
s_namePython enum name (const char* string with static storage duration)
s_docDocumentation string (const char* string with static storage duration, or nullptr)
See also
lass::python::StrEnumDefinition

Definition at line 1074 of file enum_definition.h.

◆ PY_DECLARE_STR_ENUM_EX

#define PY_DECLARE_STR_ENUM_EX ( t_cppEnum)
Value:

Defines the enumDefinition for initialization with constructor arguments for enum.StrEnum.

Use with: PY_DECLARE_STR_ENUM_EX(MyEnum)("MyEnum", "docs", { ... });

Parameters
t_cppEnumC++ enum type
See also
lass::python::StrEnumDefinition

Definition at line 1083 of file enum_definition.h.

◆ PY_MODULE_ENUM

#define PY_MODULE_ENUM ( i_module,
t_cppEnum )
Value:
LASS_EXECUTE_BEFORE_MAIN_EX\
( LASS_CONCATENATE( lassExecutePyModuleEnum_, i_module ),\
)

Adds an enum definition to a Python module.

Use this after declaring the enum with PY_DECLARE_*_ENUM_* macros. The enum will be accessible as module.EnumName in Python.

Parameters
i_moduleModule variable identifier (must be unscoped identifier for token concatenation)
t_cppEnumC++ enum type
Usage Example:
// In header:
PY_SHADOW_INT_ENUM(LASS_DLL_EXPORT, MyEnum);
// In source:
PY_DECLARE_MODULE_DOC(mymodule, "MyModule documentation");
PY_MODULE_ENUM(mymodule, MyEnum);
#define PY_DECLARE_MODULE_DOC(i_module, s_doc)
Declare a module with documentation, using the identifier as the module name.
Note
this must be called in the same translation unit (source file) that declares the module with PY_DECLARE_MODULE_* macros.

Definition at line 1117 of file enum_definition.h.

◆ PY_CLASS_ENUM

#define PY_CLASS_ENUM ( i_cppClass,
t_cppEnum )
Value:
LASS_EXECUTE_BEFORE_MAIN_EX\
( LASS_CONCATENATE( lassExecutePyClassEnum_, i_cppClass ),\
i_cppClass ::_lassPyClassDef.addInnerEnum( &::lass::python::PyExportTraits<t_cppEnum>::enumDefinition ); \
)

Adds an enum definition as a nested enum to a Python class.

Use this after declaring the enum with PY_DECLARE_*_ENUM_* macros. The enum will be accessible as ClassName.EnumName in Python.

Parameters
i_cppClassC++ class identifier (must be unscoped identifier for token concatenation)
t_cppEnumC++ enum type
Usage Example:
// In header:
PY_SHADOW_INT_ENUM(LASS_DLL_EXPORT, MyEnum);
// In source:
PY_DECLARE_CLASS_NAME(MyClass, "MyClass documentation");
PY_CLASS_ENUM(MyClass, MyEnum);
#define PY_DECLARE_CLASS_NAME(t_cppClass, s_className)
Declare a Python class with custom name but no documentation.
#define PY_CLASS_ENUM(i_cppClass, t_cppEnum)
Adds an enum definition as a nested enum to a Python class.
Note
this must be called in the same translation unit (source file) that declares the class with PY_DECLARE_CLASS_* macros.

Definition at line 1144 of file enum_definition.h.

Enumeration Type Documentation

◆ FlagBoundary

enum class lass::python::FlagBoundary
strong

Defines the boundary behavior for enum.IntFlag-derived enums.

Controls how Python handles flag values that are outside the defined enumerators

Note
This feature requires Python 3.11 or later. On earlier versions, only Keep is supported.
See also
IntFlagDefinition
PY_DECLARE_INT_FLAG_EX
Enumerator
Keep 

Allow any integer value (most permissive)

Strict 

Only allow exact flag combinations.

Conform 

Mask to defined bits only.

Definition at line 161 of file enum_definition.h.

Function Documentation

◆ makeEnumType()

LASS_PYTHON_DLL TPyObjPtr lass::python::impl::makeEnumType ( const char * name,
TPyObjPtr && enumerators,
TPyObjPtr && kwargs )

Creates a basic enum.Enum type.

Parameters
namePython class name for the enum
enumeratorsTuple of (name, value) pairs
kwargsAdditional keyword arguments for enum constructor
Returns
New enum type object

Definition at line 54 of file enum_definition.cpp.

Referenced by lass::python::EnumDefinition< EnumType, ValueType >::doFreezeDefinition(), and makeStrEnumType().

◆ makeIntEnumType()

LASS_PYTHON_DLL TPyObjPtr lass::python::impl::makeIntEnumType ( const char * name,
TPyObjPtr && enumerators,
TPyObjPtr && kwargs )

Creates an enum.IntEnum type.

Parameters
namePython class name for the enum
enumeratorsTuple of (name, value) pairs
kwargsAdditional keyword arguments for enum constructor
Returns
New enum.IntEnum type object

Definition at line 115 of file enum_definition.cpp.

Referenced by lass::python::IntEnumDefinition< EnumType >::doMakeEnumType().

◆ makeIntFlagType()

LASS_PYTHON_DLL TPyObjPtr lass::python::impl::makeIntFlagType ( const char * name,
TPyObjPtr && enumerators,
TPyObjPtr && kwargs,
FlagBoundary boundary = FlagBoundary::Keep )

Creates an enum.IntFlag type.

Parameters
namePython class name for the flag enum
enumeratorsTuple of (name, value) pairs
kwargsAdditional keyword arguments for enum constructor
boundaryBoundary behavior for invalid flag combinations
Returns
New enum.IntFlag type object

Definition at line 120 of file enum_definition.cpp.

References lass::python::Keep, and PY_ENFORCE_POINTER.

Referenced by lass::python::IntFlagDefinition< EnumType >::doMakeEnumType().

◆ makeStrEnumType()

LASS_PYTHON_DLL TPyObjPtr lass::python::impl::makeStrEnumType ( const char * name,
TPyObjPtr && enumerators,
TPyObjPtr && kwargs )

Creates an enum.StrEnum type (or equivalent for Python < 3.11).

Parameters
namePython class name for the string enum
enumeratorsTuple of (name, value) pairs where values are strings
kwargsAdditional keyword arguments for enum constructor
Returns
New enum.StrEnum type object

Definition at line 152 of file enum_definition.cpp.

References makeEnumType(), and PY_ENFORCE_POINTER.

Referenced by lass::python::StrEnumDefinition< EnumType, ValueType >::doFreezeDefinition().