Consider the C function int get_events()
, which returns a bitmask of the following events:
#define EVENT_KEY_DOWN 1
#define EVENT_KEY_UP 2
#define EVENT_KEY_PRESS 4
It could return 5
, for example, meaning both EVENT_KEY_DOWN
and EVENT_KEY_PRESS
were triggered.
I thought about the following ways to return the value from the function to Python code:
- "as is", i.e.
5
- a tuple of integers:
(1, 4)
- a tuple of strings:
('EVENT_KEY_DOWN', 'EVENT_KEY_PRESS')
(In all cases I could declare constants like mymodule.EVENT_KEY_DOWN
and mymodule.EVENT_KEY_PRESS
, as well.)
Is there any "recommended" way?