PyDocs

Nav

Data Types

Flag

enum

class (source)
  • Flag(new_class_name, /, names, *, module=None, qualname=None, type=None, start=1, boundary=None)
Support for flags
Changed in 3.11
  • 3.11: The repr() of zero-valued flags has changed. It is now: >>> Color(0) <Color: 0>
Members of Flag

_

__and__
Returns current flag binary and’ed with other:
__bool__
classes/types should always be True.
__contains__
Returns True if self has at least the same flags set as other.
__invert__
Returns all the flags in type(self) that are not in self:
__iter__
Returns flags in definition order.
__len__
Return the number of members (no aliases)
__or__
Return self|value.
__xor__
Returns current flag binary xor’ed with other:
_numeric_repr_
Return the canonical string representation of the object.
0 Examples
No examples for enum/Flag.
See Also
No see-alsos for enum/Flag
0 Notes
No notes for Flag