Rather than doing this:
for flag in flags:
c_flag = {
'embedded_data': _lib.LZC_SEND_FLAG_EMBED_DATA,
'large_blocks': _lib.LZC_SEND_FLAG_LARGE_BLOCK,
}.get(flag)
...
we can algorithmically map the original strings to string corresponding to enum names in the C code and then use getattr(_lib, ...) to obtain actual values.
Rather than doing this:
we can algorithmically map the original strings to string corresponding to enum names in the C code and then use
getattr(_lib, ...)to obtain actual values.