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]: https://github.com/python/typeshed/pull/2138
This commit is contained in:
Michael Lee
2018-05-19 09:20:16 -07:00
committed by Jelle Zijlstra
parent 6a080cd0db
commit 709b193416
4 changed files with 7 additions and 7 deletions

View File

@@ -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: ...

View File

@@ -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, ...]: ...

View File

@@ -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: ...

View File

@@ -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
@@ -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: ...