8000 Rearrange overloads to account for optional arguments (#2150) · python/typeshed@709b193 · GitHub
[go: up one dir, main page]

Skip to content

Commit 709b193

Browse files
Michael0x2aJelleZijlstra
authored andcommitted
Rearrange overloads to account for optional arguments (#2150)
Basically, the same thing as [my previous pull request][0], except the fixes are now focusing on functions with overlapping argument counts. [0]: #2138
1 parent 6a080cd commit 709b193

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

stdlib/2/os/path.pyi

Copy file name to clipboard
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ else:
140140
def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ...
141141

142142
@overload
143-
def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... # type: ignore
143+
def relpath(path: _BytesPath, start: _BytesPath) -> bytes: ... # type: ignore
144144
@overload
145-
def relpath(path: _BytesPath, start: _BytesPath) -> bytes: ...
145+
def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ...
146146

147147
def samefile(path1: _PathType, path2: _PathType) -> bool: ...
148148
def sameopenfile(fp1: int, fp2: int) -> bool: ...

stdlib/2and3/sysconfig.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ from typing import overload, Any, Dict, IO, List, Optional, Tuple, Union
55
@overload
66
def get_config_vars() -> Dict[str, Any]: ...
77
@overload
8-
def get_config_vars(*args: str) -> List[Any]: ...
8+
def get_config_vars(arg: str, *args: str) -> List[Any]: ...
99
def get_config_var(name: str) -> Optional[str]: ...
1010
def get_scheme_names() -> Tuple[str, ...]: ...
1111
def get_path_names() -> Tuple[str, ...]: ...

stdlib/3/os/path.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ else:
140140
def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ...
141141

142142
@overload
143-
def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... # type: ignore
143+
def relpath(path: _BytesPath, start: _BytesPath) -> bytes: ... # type: ignore
144144
@overload
145-
def relpath(path: _BytesPath, start: _BytesPath) -> bytes: ...
145+
def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ...
146146

147147
def samefile(path1: _PathType, path2: _PathType) -> bool: ...
148148
def sameopenfile(fp1: int, fp2: int) -> bool: ...

third_party/3/pkg_resources.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def get_entry_info(dist: _EPDistType, group: str,
108108
@overload
109109
def get_entry_map(dist: _EPDistType) -> Dict[str, Dict[str, EntryPoint]]: ...
110110
@overload
111-
def get_entry_map(dist: _EPDistType, group: str = ...) -> Dict[str, EntryPoint]: ...
111+
def get_entry_map(dist: _EPDistType, group: str) -> Dict[str, EntryPoint]: ...
112112

113113
class EntryPoint:
114114
name = ... # type: str
@@ -174,7 +174,7 @@ class Distribution(IResourceProvider, IMetadataProvider):
174174
def get_entry_map(dist: _EPDistType) \
175175
-> Dict[str, Dict[str, EntryPoint]]: ...
176176
@overload
177-
def get_entry_map(dist: _EPDistType, group: str = ...) \
177+
def get_entry_map(dist: _EPDistType, group: str) \
178178
-> Dict[str, EntryPoint]: ...
179179
def load_entry_point(dist: _EPDistType, group: str, name: str) -> None: ...
180180

0 commit comments

Comments
 (0)
0