Skip to content
Draft
Changes from 1 commit
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
Prev Previous commit
only first overload needs @Final
  • Loading branch information
randolf-scholz committed Dec 9, 2025
commit 540486668e2e3cf63ca1bd81d340ae33a4b9fc60
5 changes: 0 additions & 5 deletions stdlib/enum.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -267,21 +267,16 @@ if sys.version_info >= (3, 12):
@final
def __pow__(self, x: Literal[0], /) -> Literal[1]: ...
@overload
@final
def __pow__(self, value: Literal[0], mod: None, /) -> Literal[1]: ...
@overload
@final
def __pow__(self, value: _PositiveInteger, mod: None = None, /) -> int: ...
@overload
@final
def __pow__(self, value: _NegativeInteger, mod: None = None, /) -> float: ...
# positive __value -> int; negative __value -> float
# return type must be Any as `int | float` causes too many false-positive errors
@overload
@final
def __pow__(self, value: int, mod: None = None, /) -> Any: ...
@overload
@final
def __pow__(self, value: int, mod: int, /) -> int: ...
@final
def __rpow__(self, value: int, mod: int | None = None, /) -> Any: ...
Expand Down