Skip to content

Rearrange overloads to account for optional arguments #2150

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

Merged
merged 2 commits into from
May 19, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/2/os/path.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ else:
def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ...

@overload
def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... # type: ignore
def relpath(path: _BytesPath, start: _BytesPath) -> bytes: ... # type: ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you apply the same ordering change to stdlib3/os/path.pyi?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mkay, done.

@overload
def relpath(path: _BytesPath, start: _BytesPath) -> bytes: ...
def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ...

def samefile(path1: _PathType, path2: _PathType) -> bool: ...
def sameopenfile(fp1: int, fp2: int) -> bool: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/2and3/sysconfig.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ from typing import overload, Any, Dict, IO, List, Optional, Tuple, Union
@overload
def get_config_vars() -> Dict[str, Any]: ...
@overload
def get_config_vars(*args: str) -> List[Any]: ...
def get_config_vars(arg: str, *args: str) -> List[Any]: ...
def get_config_var(name: str) -> Optional[str]: ...
def get_scheme_names() -> Tuple[str, ...]: ...
def get_path_names() -> Tuple[str, ...]: ...
Expand Down
4 changes: 2 additions & 2 deletions stdlib/3/os/path.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ else:
def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ...

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

def samefile(path1: _PathType, path2: _PathType) -> bool: ...
def sameopenfile(fp1: int, fp2: int) -> bool: ...
Expand Down
4 changes: 2 additions & 2 deletions third_party/3/pkg_resources.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_entry_info(dist: _EPDistType, group: str,
@overload
def get_entry_map(dist: _EPDistType) -> Dict[str, Dict[str, EntryPoint]]: ...
@overload
def get_entry_map(dist: _EPDistType, group: str = ...) -> Dict[str, EntryPoint]: ...
def get_entry_map(dist: _EPDistType, group: str) -> Dict[str, EntryPoint]: ...

class EntryPoint:
name = ... # type: str
Expand Down Expand Up @@ -174,7 +174,7 @@ class Distribution(IResourceProvider, IMetadataProvider):
def get_entry_map(dist: _EPDistType) \
-> Dict[str, Dict[str, EntryPoint]]: ...
@overload
def get_entry_map(dist: _EPDistType, group: str = ...) \
def get_entry_map(dist: _EPDistType, group: str) \
-> Dict[str, EntryPoint]: ...
def load_entry_point(dist: _EPDistType, group: str, name: str) -> None: ...

Expand Down