Skip to content

Bump enum to 3.14 #14021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions stdlib/@tests/stubtest_allowlists/py314.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ dataclasses.make_dataclass
decimal.Decimal.from_number
decimal.IEEE_CONTEXT_MAX_BITS
dis.Instruction.make
enum.Enum.__signature__
enum.EnumMeta.__signature__
enum.EnumType.__signature__
faulthandler.dump_c_stack
fnmatch.__all__
fnmatch.filterfalse
Expand Down
6 changes: 5 additions & 1 deletion stdlib/enum.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ _EnumerationT = TypeVar("_EnumerationT", bound=type[Enum])
# >>> Enum('Foo', names={'RED': 1, 'YELLOW': 2})
# <enum 'Foo'>
_EnumNames: TypeAlias = str | Iterable[str] | Iterable[Iterable[str | Any]] | Mapping[str, Any]
_Signature: TypeAlias = Any # TODO: Unable to import Signature from inspect module

if sys.version_info >= (3, 11):
class nonmember(Generic[_EnumMemberT]):
Expand Down Expand Up @@ -166,6 +167,9 @@ class EnumMeta(type):
if sys.version_info >= (3, 12):
@overload
def __call__(cls: type[_EnumMemberT], value: Any, *values: Any) -> _EnumMemberT: ...
if sys.version_info >= (3, 14):
@property
def __signature__(cls) -> _Signature: ...

_member_names_: list[str] # undocumented
_member_map_: dict[str, Enum] # undocumented
Expand Down Expand Up @@ -212,7 +216,7 @@ class Enum(metaclass=EnumMeta):
if sys.version_info >= (3, 11):
def __copy__(self) -> Self: ...
def __deepcopy__(self, memo: Any) -> Self: ...
if sys.version_info >= (3, 12):
if sys.version_info >= (3, 12) and sys.version_info < (3, 14):
@classmethod
def __signature__(cls) -> str: ...

Expand Down