-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions especially welcomeContributions especially welcome
Description
Summary
Example:
import enum
from enum import Enum
class E(Enum):
A = enum.auto(), 0
B = enum.auto(), 1
C = enum.auto(), 0 # <- false positive here
def __init__(self, uid: int, flag: int) -> None:
self.uid = uid
self.flag = flag
print(E.A.value)
print(E.C.value)
print(E.A.value == E.C.value)Output:
(1, 0)
(3, 0)
False
So cleary in this example, the values are unique, but still this rule warns about an enum with duplicated value:
PIE796 Enum contains duplicate value: `enum.auto(), 0`
|
6 | A = enum.auto(), 0
7 | B = enum.auto(), 1
8 | C = enum.auto(), 0
| ^^^^^^^^^^^^^^^^^^ PIE796
9 |
10 | def __init__(self, uid: int, flag: int) -> None:
|
Version
ruff 0.9.10
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions especially welcomeContributions especially welcome