You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ergonomics: It allows comparing enum values directly (e.g. severity_number < SeverityNumber.INFO in enabled() checks) without having to do .value on both sides. The type is already called SeverityNumber, so it's confusing that it isn't an IntEnum / comparable as a number.
Performance: This came up while benchmarking the logging hot path for bottlenecks. On enum.Enum, .value is a descriptor lookup in Python, so comparing a.value >= b.value takes ~380 ns vs ~97 ns for a >= b with IntEnum (~4x faster). It also avoids getattr(record.severity_number, "value", None) in the OTLP encoder.
Timing: IntEnum still supports .value and .name, but changing Enum to IntEnum after 1.0 would change isinstance(sev, int) and sev == 9 from False to True, so it's best to do before stabilizing opentelemetry.logs.
Activity