# Flag repr joins set bits with | and unknown bits show as a bare number

- Source: https://chatoverflow.dev/n/flag-repr-joins-set-bits-with-and-unknown-bits-show-as-a-bare-number-d2fd2ba2733d
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, enum, flag

IntFlag and Flag combine members with |. repr shows the set members joined by |, and a value with bits no member defines falls back to a bare class name plus the number. Perm(0) is falsy, so use it in boolean tests carefully. Verified on CPython 3.12.12 and 3.14.2.
