Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builtins: rename _LT #4579

Merged
merged 1 commit into from
Sep 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 19 additions & 15 deletions stdlib/2/__builtin__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ _T3 = TypeVar("_T3")
_T4 = TypeVar("_T4")
_T5 = TypeVar("_T5")
_TT = TypeVar("_TT", bound="type")
_LT = TypeVar("_LT", bound=_SupportsLessThan)
_SupportsLessThanT = TypeVar("_SupportsLessThanT", bound=_SupportsLessThan)
_TBE = TypeVar("_TBE", bound="BaseException")

class object:
Expand Down Expand Up @@ -962,7 +962,7 @@ class list(MutableSequence[_T], Generic[_T]):
def reverse(self) -> None: ...
if sys.version_info >= (3,):
@overload
def sort(self: List[_LT], *, key: None = ..., reverse: bool = ...) -> None: ...
def sort(self: List[_SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> None: ...
@overload
def sort(self, *, key: Callable[[_T], _SupportsLessThan], reverse: bool = ...) -> None: ...
else:
Expand Down Expand Up @@ -1440,17 +1440,19 @@ else:

if sys.version_info >= (3,):
@overload
def max(__arg1: _LT, __arg2: _LT, *_args: _LT, key: None = ...) -> _LT: ...
def max(
__arg1: _SupportsLessThanT, __arg2: _SupportsLessThanT, *_args: _SupportsLessThanT, key: None = ...
) -> _SupportsLessThanT: ...
@overload
def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _LT]) -> _T: ...
def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
@overload
def max(__iterable: Iterable[_LT], *, key: None = ...) -> _LT: ...
def max(__iterable: Iterable[_SupportsLessThanT], *, key: None = ...) -> _SupportsLessThanT: ...
@overload
def max(__iterable: Iterable[_T], *, key: Callable[[_T], _LT]) -> _T: ...
def max(__iterable: Iterable[_T], *, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
@overload
def max(__iterable: Iterable[_LT], *, key: None = ..., default: _T) -> Union[_LT, _T]: ...
def max(__iterable: Iterable[_SupportsLessThanT], *, key: None = ..., default: _T) -> Union[_SupportsLessThanT, _T]: ...
@overload
def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], _LT], default: _T2) -> Union[_T1, _T2]: ...
def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], _SupportsLessThanT], default: _T2) -> Union[_T1, _T2]: ...

else:
@overload
Expand All @@ -1460,17 +1462,19 @@ else:

if sys.version_info >= (3,):
@overload
def min(__arg1: _LT, __arg2: _LT, *_args: _LT, key: None = ...) -> _LT: ...
def min(
__arg1: _SupportsLessThanT, __arg2: _SupportsLessThanT, *_args: _SupportsLessThanT, key: None = ...
) -> _SupportsLessThanT: ...
@overload
def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _LT]) -> _T: ...
def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
@overload
def min(__iterable: Iterable[_LT], *, key: None = ...) -> _LT: ...
def min(__iterable: Iterable[_SupportsLessThanT], *, key: None = ...) -> _SupportsLessThanT: ...
@overload
def min(__iterable: Iterable[_T], *, key: Callable[[_T], _LT]) -> _T: ...
def min(__iterable: Iterable[_T], *, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
@overload
def min(__iterable: Iterable[_LT], *, key: None = ..., default: _T) -> Union[_LT, _T]: ...
def min(__iterable: Iterable[_SupportsLessThanT], *, key: None = ..., default: _T) -> Union[_SupportsLessThanT, _T]: ...
@overload
def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], _LT], default: _T2) -> Union[_T1, _T2]: ...
def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], _SupportsLessThanT], default: _T2) -> Union[_T1, _T2]: ...

else:
@overload
Expand Down Expand Up @@ -1671,7 +1675,7 @@ def setattr(__obj: Any, __name: Text, __value: Any) -> None: ...

if sys.version_info >= (3,):
@overload
def sorted(__iterable: Iterable[_LT], *, key: None = ..., reverse: bool = ...) -> List[_LT]: ...
def sorted(__iterable: Iterable[_SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> List[_SupportsLessThanT]: ...
@overload
def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], _SupportsLessThan], reverse: bool = ...) -> List[_T]: ...

Expand Down
34 changes: 19 additions & 15 deletions stdlib/2and3/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ _T3 = TypeVar("_T3")
_T4 = TypeVar("_T4")
_T5 = TypeVar("_T5")
_TT = TypeVar("_TT", bound="type")
_LT = TypeVar("_LT", bound=_SupportsLessThan)
_SupportsLessThanT = TypeVar("_SupportsLessThanT", bound=_SupportsLessThan)
_TBE = TypeVar("_TBE", bound="BaseException")

class object:
Expand Down Expand Up @@ -962,7 +962,7 @@ class list(MutableSequence[_T], Generic[_T]):
def reverse(self) -> None: ...
if sys.version_info >= (3,):
@overload
def sort(self: List[_LT], *, key: None = ..., reverse: bool = ...) -> None: ...
def sort(self: List[_SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> None: ...
@overload
def sort(self, *, key: Callable[[_T], _SupportsLessThan], reverse: bool = ...) -> None: ...
else:
Expand Down Expand Up @@ -1440,17 +1440,19 @@ else:

if sys.version_info >= (3,):
@overload
def max(__arg1: _LT, __arg2: _LT, *_args: _LT, key: None = ...) -> _LT: ...
def max(
__arg1: _SupportsLessThanT, __arg2: _SupportsLessThanT, *_args: _SupportsLessThanT, key: None = ...
) -> _SupportsLessThanT: ...
@overload
def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _LT]) -> _T: ...
def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
@overload
def max(__iterable: Iterable[_LT], *, key: None = ...) -> _LT: ...
def max(__iterable: Iterable[_SupportsLessThanT], *, key: None = ...) -> _SupportsLessThanT: ...
@overload
def max(__iterable: Iterable[_T], *, key: Callable[[_T], _LT]) -> _T: ...
def max(__iterable: Iterable[_T], *, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
@overload
def max(__iterable: Iterable[_LT], *, key: None = ..., default: _T) -> Union[_LT, _T]: ...
def max(__iterable: Iterable[_SupportsLessThanT], *, key: None = ..., default: _T) -> Union[_SupportsLessThanT, _T]: ...
@overload
def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], _LT], default: _T2) -> Union[_T1, _T2]: ...
def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], _SupportsLessThanT], default: _T2) -> Union[_T1, _T2]: ...

else:
@overload
Expand All @@ -1460,17 +1462,19 @@ else:

if sys.version_info >= (3,):
@overload
def min(__arg1: _LT, __arg2: _LT, *_args: _LT, key: None = ...) -> _LT: ...
def min(
__arg1: _SupportsLessThanT, __arg2: _SupportsLessThanT, *_args: _SupportsLessThanT, key: None = ...
) -> _SupportsLessThanT: ...
@overload
def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _LT]) -> _T: ...
def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
@overload
def min(__iterable: Iterable[_LT], *, key: None = ...) -> _LT: ...
def min(__iterable: Iterable[_SupportsLessThanT], *, key: None = ...) -> _SupportsLessThanT: ...
@overload
def min(__iterable: Iterable[_T], *, key: Callable[[_T], _LT]) -> _T: ...
def min(__iterable: Iterable[_T], *, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
@overload
def min(__iterable: Iterable[_LT], *, key: None = ..., default: _T) -> Union[_LT, _T]: ...
def min(__iterable: Iterable[_SupportsLessThanT], *, key: None = ..., default: _T) -> Union[_SupportsLessThanT, _T]: ...
@overload
def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], _LT], default: _T2) -> Union[_T1, _T2]: ...
def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], _SupportsLessThanT], default: _T2) -> Union[_T1, _T2]: ...

else:
@overload
Expand Down Expand Up @@ -1671,7 +1675,7 @@ def setattr(__obj: Any, __name: Text, __value: Any) -> None: ...

if sys.version_info >= (3,):
@overload
def sorted(__iterable: Iterable[_LT], *, key: None = ..., reverse: bool = ...) -> List[_LT]: ...
def sorted(__iterable: Iterable[_SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> List[_SupportsLessThanT]: ...
@overload
def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], _SupportsLessThan], reverse: bool = ...) -> List[_T]: ...

Expand Down