Django models.TextChoices не является индексируемым?

Я сделал проект на django и применил подсказку типов с помощью pytype. Но pytype выдает мне ошибку типа вот такую

type_test.py", line 11, in <module>: class ReportCategoryChoices is not indexable [not-indexable]
  ('ReportCategoryChoices' does not subclass Generic)

For more details, see https://google.github.io/pytype/errors.html#not-indexable
ninja: build stopped: subcommand failed.
type_test.py
category = ReportCategoryChoices['A']

и вот ReportCategoryClass

class ReportCategoryChoices(models.TextChoices):
     A = "A", _("a")
     B = "B", _("b")
     C = "C", _("c")

# type of ReportCategoryChoices: <class 'django.db.models.enums.ChoicesMeta'>

в django ReportCategoryClass является индексируемым. почему pytype сказал, что ReportCategory не является индексируемым?

Пожалуйста, посмотрите примеры, прежде чем писать здесь...

Вернуться на верх