Open MrBr-github opened 4 years ago
This is a rather confusing usage of dict. Idiomatic approach for this case (at least in C) would be using of bitmask:
dict
QUERY_PRESET_MST = 0x1 << 1 QUERY_PRESET_FOO = 0x1 << 2 QUERY_PRESET_BAR = 0x1 << 3 ... if query_preset & QUERY_PRESET_BAR: ...
Not sure if it is a pythonic way, but here is a good standard module (since 3.6, heh): https://docs.python.org/3/library/enum.html#flag
Originally posted by @amaslenn in https://github.com/MrBr-github/lshca/pull/1
Handle this as soon as we'll have an installer and will be able to contain some prerequisites for python 2.7
This is a rather confusing usage of
dict
. Idiomatic approach for this case (at least in C) would be using of bitmask:Not sure if it is a pythonic way, but here is a good standard module (since 3.6, heh): https://docs.python.org/3/library/enum.html#flag
Originally posted by @amaslenn in https://github.com/MrBr-github/lshca/pull/1