[Python-ideas] a set of enum.Enum values rather than the construction of bit-sets as the "norm"?

Paddy3118 paddy3118 at gmail.com
Tue Dec 26 15:07:52 EST 2017

Maybe it is time to deemphasize the creation and passing of what is, in 
effect, bit-sets <https://en.wikipedia.org/wiki/Bit_array>as a single 
argument, and instead promote the passing of a set of members of an 
enum.Enum <https://docs.python.org/3/library/enum.html> constants.

Thi comes about because someone wrote a description, (since deleted), of 
constructing bit-sets to use in passing flags to, for example, the 
re.compile <https://docs.python.org/3/library/re.html#re.compile>function. 
The use of individual bits in a bit-array/bit-set to pass multiple flags is 
an implementation detail. Should we not *first *teach the passing of a set 
of enum.Enum constant values in one argument as the *pythonic *way; and 
leave bit-sets and other types of enum's as a performance or 
interoperability detail?

Comments please, (And a happy new year to you :-)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171226/f8b41a9d/attachment.html>

More information about the Python-ideas mailing list