Skip to content

Commit 74aac1a

Browse files
authored
Don't pretend EnumMeta inherits from ABCMeta (#10577)
1 parent 320a9c3 commit 74aac1a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

stdlib/enum.pyi

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import _typeshed
22
import sys
33
import types
44
from _typeshed import SupportsKeysAndGetItem, Unused
5-
from abc import ABCMeta
65
from builtins import property as _builtins_property
76
from collections.abc import Callable, Iterable, Iterator, Mapping
87
from typing import Any, Generic, TypeVar, overload
@@ -76,12 +75,8 @@ class _EnumDict(dict[str, Any]):
7675
@overload
7776
def update(self, members: Iterable[tuple[str, Any]], **more_members: Any) -> None: ...
7877

79-
# Note: EnumMeta actually subclasses type directly, not ABCMeta.
80-
# This is a temporary workaround to allow multiple creation of enums with builtins
81-
# such as str as mixins, which due to the handling of ABCs of builtin types, cause
82-
# spurious inconsistent metaclass structure. See #1595.
8378
# Structurally: Iterable[T], Reversible[T], Container[T] where T is the enum itself
84-
class EnumMeta(ABCMeta):
79+
class EnumMeta(type):
8580
if sys.version_info >= (3, 11):
8681
def __new__(
8782
metacls: type[_typeshed.Self],

0 commit comments

Comments
 (0)