[Python-ideas] a set of enum.Enum values rather than the construction of bit-sets as the "norm"?
mistersheik at gmail.com
Tue Dec 26 18:28:34 EST 2017
Wouldn't it be more pythonic to just pass flags to re.compile as Boolean
On Tuesday, December 26, 2017 at 3:07:52 PM UTC-5, Paddy3118 wrote:
> 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...
More information about the Python-ideas