From 566ff0067ce9bb0ccb7120a74bef9111636eefd5 Mon Sep 17 00:00:00 2001 From: Guo Ci Date: Sat, 7 Feb 2026 15:02:23 -0500 Subject: [PATCH 1/2] [stdlib/enum] add `enum.bin` docs: https://docs.python.org/dev/library/enum.html#enum.bin source: https://github.com/python/cpython/blob/3.11/Lib/enum.py#L132-L154 --- stdlib/enum.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/enum.pyi b/stdlib/enum.pyi index c6cc5a961ee7..2949a49746a4 100644 --- a/stdlib/enum.pyi +++ b/stdlib/enum.pyi @@ -4,7 +4,7 @@ import types from _typeshed import SupportsKeysAndGetItem, Unused from builtins import property as _builtins_property from collections.abc import Callable, Iterable, Iterator, Mapping -from typing import Any, Final, Generic, Literal, TypeVar, overload +from typing import Any, Final, Generic, Literal, SupportsIndex, TypeVar, overload from typing_extensions import Self, TypeAlias, disjoint_base __all__ = ["EnumMeta", "Enum", "IntEnum", "Flag", "IntFlag", "auto", "unique"] @@ -311,6 +311,7 @@ if sys.version_info >= (3, 11): def global_enum_repr(self: Enum) -> str: ... def global_flag_repr(self: Flag) -> str: ... def show_flag_values(value: int) -> list[int]: ... + def bin(num: int | SupportsIndex, max_bits: int | None = None) -> str: ... if sys.version_info >= (3, 12): # The body of the class is the same, but the base classes are different. From 0725d112dd5b375f629c9b41263ff72a26fdc8c2 Mon Sep 17 00:00:00 2001 From: Guo Ci Date: Sat, 7 Feb 2026 15:30:54 -0500 Subject: [PATCH 2/2] Update stdlib/enum.pyi Co-authored-by: Jelle Zijlstra --- stdlib/enum.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/enum.pyi b/stdlib/enum.pyi index 2949a49746a4..f9b53e1d45f1 100644 --- a/stdlib/enum.pyi +++ b/stdlib/enum.pyi @@ -311,7 +311,7 @@ if sys.version_info >= (3, 11): def global_enum_repr(self: Enum) -> str: ... def global_flag_repr(self: Flag) -> str: ... def show_flag_values(value: int) -> list[int]: ... - def bin(num: int | SupportsIndex, max_bits: int | None = None) -> str: ... + def bin(num: SupportsIndex, max_bits: int | None = None) -> str: ... if sys.version_info >= (3, 12): # The body of the class is the same, but the base classes are different.