Consider the C int get_events() function, which returns a bit mask for the following events:
#define EVENT_KEY_DOWN 1 #define EVENT_KEY_UP 2 #define EVENT_KEY_PRESS 4
It could return 5 , for example, which meant running EVENT_KEY_DOWN and EVENT_KEY_PRESS .
I thought of the following ways to return a value from a function in Python code:
- "as is", that is
5 - set of integers:
(1, 4) - tuple of rows:
('EVENT_KEY_DOWN', 'EVENT_KEY_PRESS')
(In all cases, I could declare constants such as mymodule.EVENT_KEY_DOWN and mymodule.EVENT_KEY_PRESS .)
Is there a "recommended" way?
source share