On this page
  1. enum.global_flag_repr
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

enum.global_flag_repr

Prev: enum.global_enum_repr | Up: enum | Next: enum.global_str
Rel: enum.auto, enum.Enum, enum.EnumCheck, enum.EnumDict
Ref: docs.python.org — enum.global_flag_repr
Tags: #public #python3 #stdlib #enum


Import

import enum
from enum import global_flag_repr

Signature & Overview

enum.global_flag_repr(self)

use module.flag_name instead of class.flag_name the module is the last module in case of a multi-module name

Usage

from enum import Flag, global_flag_repr

class Bits(Flag):
    A = 1
    B = 2

assert "A" in global_flag_repr(Bits.A | Bits.B)

Gotchas

REPL Inspect

from enum import global_flag_repr
help(global_flag_repr)

Linked from

Related notes