Skip to content

Commit 9cba086

Browse files
authored
Bump enum to 3.14 (#14021)
1 parent ddf6c62 commit 9cba086

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

stdlib/@tests/stubtest_allowlists/py314.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ ctypes.wintypes.HDROP
3838
ctypes.wintypes.HFILE
3939
ctypes.wintypes.HRESULT
4040
ctypes.wintypes.HSZ
41-
enum.Enum.__signature__
42-
enum.EnumMeta.__signature__
43-
enum.EnumType.__signature__
4441
faulthandler.dump_c_stack
4542
fractions.Fraction.__pow__
4643
fractions.Fraction.__rpow__

stdlib/enum.pyi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ _EnumerationT = TypeVar("_EnumerationT", bound=type[Enum])
5353
# >>> Enum('Foo', names={'RED': 1, 'YELLOW': 2})
5454
# <enum 'Foo'>
5555
_EnumNames: TypeAlias = str | Iterable[str] | Iterable[Iterable[str | Any]] | Mapping[str, Any]
56+
_Signature: TypeAlias = Any # TODO: Unable to import Signature from inspect module
5657

5758
if sys.version_info >= (3, 11):
5859
class nonmember(Generic[_EnumMemberT]):
@@ -166,6 +167,9 @@ class EnumMeta(type):
166167
if sys.version_info >= (3, 12):
167168
@overload
168169
def __call__(cls: type[_EnumMemberT], value: Any, *values: Any) -> _EnumMemberT: ...
170+
if sys.version_info >= (3, 14):
171+
@property
172+
def __signature__(cls) -> _Signature: ...
169173

170174
_member_names_: list[str] # undocumented
171175
_member_map_: dict[str, Enum] # undocumented
@@ -212,7 +216,7 @@ class Enum(metaclass=EnumMeta):
212216
if sys.version_info >= (3, 11):
213217
def __copy__(self) -> Self: ...
214218
def __deepcopy__(self, memo: Any) -> Self: ...
215-
if sys.version_info >= (3, 12):
219+
if sys.version_info >= (3, 12) and sys.version_info < (3, 14):
216220
@classmethod
217221
def __signature__(cls) -> str: ...
218222

0 commit comments

Comments
 (0)