Defining a Python enum in a C extension - am I doing this right?

Serhiy Storchaka storchaka at gmail.com
Fri Jul 30 04:21:35 EDT 2021


23.07.21 11:20, Bartosz Golaszewski пише:
> I'm working on a Python C extension and I would like to expose a
> custom enum (as in: a class inheriting from enum.Enum) that would be
> entirely defined in C.

I think that it would be much easier to define it in Python, and then
either import a Python module in your C code, or exec a Python code as a
string.



More information about the Python-list mailing list