﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30920	Choice enumeration types should not enforce enum.unique().	Steve Jorgensen	nobody	"The stated reason that Choice enumeration types enforce `enum.unique()` is ""to ensure that values cannot be defined multiple times"" but that's a misunderstanding of how `Enum` works with values and what `enum.unique()` is for.

`Enum` already enforces that no 2 instances may have the same value, but by default, it allows 2 or more attributes to refer to that same instance.

I believe that is desirable to allow situations like the following:

{{{
class Vehicle(models.TextChoices):
    CAR = 'C'
    TRUCK = 'T'
    JET_SKI = 'J'
    DEFAULT = 'C'
}}}

With `enum.unique()` ''not'' enforced, this will create 3 entries (not 4) and make the single `CAR` entry instance available through either `Vehicle.CAR` or `Vehicle.DEFAULT`. By enforcing `enum.unique()`, we cause an exception to be raised at `DEFAULT = 'C'` instead of making an alias to `Vehicle.CAR`, and that appears to be purely a limitation and not a benefit."	New feature	closed	Database layer (models, ORM)	3.0	Normal	wontfix		Shai Berger pope1ni	Unreviewed	0	0	0	0	0	0
