mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
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:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user