Какой из них мне следует использовать, чтобы проверить уникальность значений перечисления в Python?Python

Программы на Python
Anonymous
Какой из них мне следует использовать, чтобы проверить уникальность значений перечисления в Python?

Сообщение Anonymous »


I have an enum in Python, which I want to make sure that its values are unique. I see that there are 2 ways I can use to achieve it:
  • Wrapping the class with @verify(UNIQUE)
  • Wrapping the class with @unique

What is the difference with using each one of them? Which one should I use to gain the best performance?


Источник: https://stackoverflow.com/questions/780 ... s-in-pytho

Вернуться в «Python»