-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Closed
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
The following snippet has a different output on Python 3.11.0b3 than on <= 3.10:
import enum
class StrMixin:
def __str__(self):
return f"__str__ from {self.__class__.__name__} {self.value}"
class MyEnumTuple(tuple, StrMixin, enum.Enum):
FIELD = (1, 0)
x = MyEnumTuple((1, 0))
print(x)On 3.10 and earlier it outputs:
__str__ from EnumMixin (1, 0)
On 3.11.0b3 it outputs this:
MyEnumTuple.FIELD
My environment
- CPython versions tested on: 3.11.0b3, 3.10.1, 3.9.7
- Operating system and architecture: macOS 10.15.7, x86_64
anthrotype and harshil21
Metadata
Metadata
Assignees
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error