Improve int.__pow__ and float.__pow__ comments (#10925)

It used to be `__x`. Now, it is not clear what `x` is in this context.
This commit is contained in:
Nikita Sobolev
2023-10-25 12:15:34 +03:00
committed by GitHub
parent 40caa050ce
commit 5c775a3502

View File

@@ -288,7 +288,7 @@ class int:
def __pow__(self, __value: _PositiveInteger, __mod: None = None) -> int: ...
@overload
def __pow__(self, __value: _NegativeInteger, __mod: None = None) -> float: ...
# positive x -> int; negative x -> float
# positive __value -> int; negative __value -> float
# return type must be Any as `int | float` causes too many false-positive errors
@overload
def __pow__(self, __value: int, __mod: None = None) -> Any: ...
@@ -347,7 +347,7 @@ class float:
def __divmod__(self, __value: float) -> tuple[float, float]: ...
@overload
def __pow__(self, __value: int, __mod: None = None) -> float: ...
# positive x -> float; negative x -> complex
# positive __value -> float; negative __value -> complex
# return type must be Any as `float | complex` causes too many false-positive errors
@overload
def __pow__(self, __value: float, __mod: None = None) -> Any: ...