> class BarTextChoices(TextChoices):
> GBP = "£"
> PERCENT = "%"
> setattr(foo, 'adhoc_fee_type', BarTextChoices.GBP)
> foo.adhoc_fee_type == '£'
returns True
> class BarEnum(Enum):
> GBP = "£"
> PERCENT = "%"
> setattr(foo, 'adhoc_fee_type', BarEnum.GBP)
> foo.adhoc_fee_type == '£'
returns False
Notice the equality returns True for
TextChoices but False for Enum
!