adaptix icon indicating copy to clipboard operation
adaptix copied to clipboard

Add provider for Flag representing its values by names

Open zhPavel opened this issue 3 years ago • 0 comments

class Color(Flag):
    RED = auto()
    BLUE = auto()
    GREEN = auto()
    WHITE = RED | BLUE | GREEN

Color.RED -> ['RED'] Color.RED | Color.BLUE -> ['RED', 'BLUE']

The provider should have such options:

  1. Interpret string as a list of one element or forbid this
  2. Forbid duplicating values at list parsing
  3. Use special names for compound values (e.g. Color.RED | Color.BLUE | GREEN -> ['WHITE'])

zhPavel avatar Aug 27 '22 19:08 zhPavel