On Fri, May 28, 2021 at 7:00 PM Joao S. O. Bueno <jsbu...@python.org.br> wrote:
> "check_all_bits_defined" or something along it.

Best suggestion so far. Similar:

"ensure_all_bits_named"

I am all for brainstorming, as we've been doing for a few days. Maybe
we need to brainstorm some more.

I just don't think the goal should be finding a one/two-word name for
the decorator.

I see no need to find something shorter than a short sentence. After
all, defining a new enum is not something we do all the time.

Cheers,

Luciano


>
> On Fri, 28 May 2021 at 18:30, Ethan Furman <et...@stoneleaf.us> wrote:
>>
>> On 5/28/21 12:43 AM, Petr Viktorin wrote:
>>  > On 28. 05. 21 5:24, Ethan Furman wrote:
>>
>>  >>      class FlagWithMasks(IntFlag):
>>  >>          DEFAULT = 0x0
>>  >>
>>  >>          FIRST_MASK = 0xF
>>  >>          FIRST_ROUND = 0x0
>>  >>          FIRST_CEIL = 0x1
>>  >>          FIRST_TRUNC = 0x2
>>  >>
>>  >>          SECOND_MASK = 0xF0
>>  >>          SECOND_RECALC = 0x00
>>  >>          SECOND_NO_RECALC = 0x10
>>  >>
>>  >>          THIRD_MASK = 0xF00
>>  >>          THIRD_DISCARD = 0x000
>>  >>          THIRD_KEEP = 0x100
>>  >>
>>  >> Here we have three flags (FIRST_MASK, SECOND_MASK, THIRD_MASK) that are 
>> aliasing values
>>  >> that don't exist, but it seems intentional and not an error.
>>  >
>>  > Are you looking for a decorator for the whole Enum, or a way to mark 
>> individual *values* as masks?
>>
>> The decorator is for whole enum.  The issue is not that some values are 
>> masks, but whether the absence of named bits
>> covered by the mask is an error.
>>
>> --
>> ~Ethan~
>> _______________________________________________
>> Python-Dev mailing list -- python-dev@python.org
>> To unsubscribe send an email to python-dev-le...@python.org
>> https://mail.python.org/mailman3/lists/python-dev.python.org/
>> Message archived at 
>> https://mail.python.org/archives/list/python-dev@python.org/message/OM5M774MP5QPLFXZ7OVGBPR7ZFB6X35A/
>> Code of Conduct: http://python.org/psf/codeofconduct/
>
> _______________________________________________
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at 
> https://mail.python.org/archives/list/python-dev@python.org/message/WX7YCSRRDJWLVJUMLGBZL34OP7JW4MDQ/
> Code of Conduct: http://python.org/psf/codeofconduct/



-- 
Luciano Ramalho
|  Author of Fluent Python (O'Reilly, 2015)
|     http://shop.oreilly.com/product/0636920032519.do
|  Technical Principal at ThoughtWorks
|  Twitter: @ramalhoorg
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/3BBRVAW2AKDUXNJYLCIPK2V7BX4CWMGF/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to