"""A demonstration of pylint weirdness.""" import enum class Weird(enum.Enum): """A not-so-weird class.""" FIRST = "first" SECOND = "second" def __str__(self): # type: (Weird) -> str assert isinstance(self.value, str) return self.value class WeirdStr(str, enum.Enum): """Another not-so-weird class.""" FIRST = "first" SECOND = "second" def __str__(self): # type: (WeirdStr) -> str assert isinstance(self.value, str) return self.value class NotWeird(enum.Enum): """An even less weird class.""" FIRST = "first" SECOND = "second" def __str__(self) -> str: assert isinstance(self.value, str) return self.value class NotWeirdAtAll(str, enum.Enum): """A class, mmkay?""" FIRST = "first" SECOND = "second" def __str__(self) -> str: assert isinstance(self.value, str) return self.value