Clean up files with former forced consistency (#4717)

Replace Text with str in Python 3 code
This commit is contained in:
Sebastian Rittau
2020-10-27 07:52:35 +01:00
committed by GitHub
parent 25b3004ad8
commit 4603728a15
24 changed files with 364 additions and 636 deletions

View File

@@ -26,13 +26,6 @@ class BaseServer:
def server_activate(self) -> None: ...
def server_bind(self) -> None: ...
def verify_request(self, request: bytes, client_address: Tuple[str, int]) -> bool: ...
if sys.version_info >= (3, 6):
def __enter__(self) -> BaseServer: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[types.TracebackType]
) -> None: ...
if sys.version_info >= (3, 3):
def service_actions(self) -> None: ...
class TCPServer(BaseServer):
def __init__(
@@ -71,27 +64,14 @@ if sys.platform != "win32":
timeout: Optional[float] # undocumented
active_children: Optional[List[int]] # undocumented
max_children: int # undocumented
if sys.version_info >= (3, 7):
block_on_close: bool
if sys.version_info >= (3, 6):
def collect_children(self, *, blocking: bool = ...) -> None: ... # undocumented
else:
def collect_children(self) -> None: ... # undocumented
def collect_children(self) -> None: ... # undocumented
def handle_timeout(self) -> None: ... # undocumented
if sys.version_info >= (3, 3):
def service_actions(self) -> None: ... # undocumented
def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ...
if sys.version_info >= (3, 6):
def server_close(self) -> None: ...
class ThreadingMixIn:
daemon_threads: bool
if sys.version_info >= (3, 7):
block_on_close: bool
def process_request_thread(self, request: bytes, client_address: Tuple[str, int]) -> None: ... # undocumented
def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ...
if sys.version_info >= (3, 6):
def server_close(self) -> None: ...
if sys.platform != "win32":
class ForkingTCPServer(ForkingMixIn, TCPServer): ...

View File

@@ -60,9 +60,6 @@ REG_EXPAND_SZ: int
REG_LINK: int
REG_MULTI_SZ: int
REG_NONE: int
if sys.version_info >= (3, 6):
REG_QWORD: int
REG_QWORD_LITTLE_ENDIAN: int
REG_RESOURCE_LIST: int
REG_FULL_RESOURCE_DESCRIPTOR: int
REG_RESOURCE_REQUIREMENTS_LIST: int

85
stdlib/2/ntpath.pyi Normal file
View File

@@ -0,0 +1,85 @@
import os
import sys
from _typeshed import AnyPath, BytesPath, StrPath
from genericpath import exists as exists
from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, overload
_T = TypeVar("_T")
# ----- os.path variables -----
supports_unicode_filenames: bool
# aliases (also in os)
curdir: str
pardir: str
sep: str
if sys.platform == "win32":
altsep: str
else:
altsep: Optional[str]
extsep: str
pathsep: str
defpath: str
devnull: str
# ----- os.path function stubs -----
def abspath(path: AnyStr) -> AnyStr: ...
def basename(p: AnyStr) -> AnyStr: ...
def dirname(p: AnyStr) -> AnyStr: ...
def expanduser(path: AnyStr) -> AnyStr: ...
def expandvars(path: AnyStr) -> AnyStr: ...
def normcase(s: AnyStr) -> AnyStr: ...
def normpath(path: AnyStr) -> AnyStr: ...
if sys.platform == "win32":
def realpath(path: AnyStr) -> AnyStr: ...
else:
def realpath(filename: AnyStr) -> AnyStr: ...
# NOTE: Empty lists results in '' (str) regardless of contained type.
# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes
# So, fall back to Any
def commonprefix(m: Sequence[AnyPath]) -> Any: ...
def lexists(path: AnyPath) -> bool: ...
# These return float if os.stat_float_times() == True,
# but int is a subclass of float.
def getatime(filename: AnyPath) -> float: ...
def getmtime(filename: AnyPath) -> float: ...
def getctime(filename: AnyPath) -> float: ...
def getsize(filename: AnyPath) -> int: ...
def isabs(s: AnyPath) -> bool: ...
def isfile(path: AnyPath) -> bool: ...
def isdir(s: AnyPath) -> bool: ...
def islink(path: AnyPath) -> bool: ...
def ismount(path: AnyPath) -> bool: ...
# Make sure signatures are disjunct, and allow combinations of bytes and unicode.
# (Since Python 2 allows that, too)
# Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in
# a type error.
@overload
def join(__p1: bytes, *p: bytes) -> bytes: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: bytes, __p2: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: Text, *p: AnyPath) -> Text: ...
@overload
def relpath(path: BytesPath, start: Optional[BytesPath] = ...) -> bytes: ...
@overload
def relpath(path: StrPath, start: Optional[StrPath] = ...) -> Text: ...
def samefile(f1: AnyPath, f2: AnyPath) -> bool: ...
def sameopenfile(fp1: int, fp2: int) -> bool: ...
def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ...
def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
if sys.platform == "win32":
def splitunc(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated
def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ...

View File

@@ -6,9 +6,6 @@ from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple,
_T = TypeVar("_T")
if sys.version_info >= (3, 6):
from builtins import _PathLike
# ----- os.path variables -----
supports_unicode_filenames: bool
# aliases (also in os)
@@ -25,67 +22,19 @@ defpath: str
devnull: str
# ----- os.path function stubs -----
if sys.version_info >= (3, 6):
# Overloads are necessary to work around python/mypy#3644.
@overload
def abspath(path: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def abspath(path: AnyStr) -> AnyStr: ...
@overload
def basename(p: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def basename(p: AnyStr) -> AnyStr: ...
@overload
def dirname(p: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def dirname(p: AnyStr) -> AnyStr: ...
@overload
def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def expanduser(path: AnyStr) -> AnyStr: ...
@overload
def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def expandvars(path: AnyStr) -> AnyStr: ...
@overload
def normcase(s: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def normcase(s: AnyStr) -> AnyStr: ...
@overload
def normpath(path: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def normpath(path: AnyStr) -> AnyStr: ...
if sys.platform == "win32":
@overload
def realpath(path: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def realpath(path: AnyStr) -> AnyStr: ...
else:
@overload
def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def realpath(filename: AnyStr) -> AnyStr: ...
def abspath(path: AnyStr) -> AnyStr: ...
def basename(p: AnyStr) -> AnyStr: ...
def dirname(p: AnyStr) -> AnyStr: ...
def expanduser(path: AnyStr) -> AnyStr: ...
def expandvars(path: AnyStr) -> AnyStr: ...
def normcase(s: AnyStr) -> AnyStr: ...
def normpath(path: AnyStr) -> AnyStr: ...
if sys.platform == "win32":
def realpath(path: AnyStr) -> AnyStr: ...
else:
def abspath(path: AnyStr) -> AnyStr: ...
def basename(p: AnyStr) -> AnyStr: ...
def dirname(p: AnyStr) -> AnyStr: ...
def expanduser(path: AnyStr) -> AnyStr: ...
def expandvars(path: AnyStr) -> AnyStr: ...
def normcase(s: AnyStr) -> AnyStr: ...
def normpath(path: AnyStr) -> AnyStr: ...
if sys.platform == "win32":
def realpath(path: AnyStr) -> AnyStr: ...
else:
def realpath(filename: AnyStr) -> AnyStr: ...
if sys.version_info >= (3, 6):
# In reality it returns str for sequences of StrPath and bytes for sequences
# of BytesPath, but mypy does not accept such a signature.
def commonpath(paths: Sequence[AnyPath]) -> Any: ...
elif sys.version_info >= (3, 5):
def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ...
def realpath(filename: AnyStr) -> AnyStr: ...
# NOTE: Empty lists results in '' (str) regardless of contained type.
# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes
@@ -105,31 +54,20 @@ def isdir(s: AnyPath) -> bool: ...
def islink(path: AnyPath) -> bool: ...
def ismount(path: AnyPath) -> bool: ...
if sys.version_info < (3, 0):
# Make sure signatures are disjunct, and allow combinations of bytes and unicode.
# (Since Python 2 allows that, too)
# Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in
# a type error.
@overload
def join(__p1: bytes, *p: bytes) -> bytes: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: bytes, __p2: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: Text, *p: AnyPath) -> Text: ...
elif sys.version_info >= (3, 6):
@overload
def join(a: StrPath, *paths: StrPath) -> Text: ...
@overload
def join(a: BytesPath, *paths: BytesPath) -> bytes: ...
else:
def join(a: AnyStr, *paths: AnyStr) -> AnyStr: ...
# Make sure signatures are disjunct, and allow combinations of bytes and unicode.
# (Since Python 2 allows that, too)
# Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in
# a type error.
@overload
def join(__p1: bytes, *p: bytes) -> bytes: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: bytes, __p2: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: Text, *p: AnyPath) -> Text: ...
@overload
def relpath(path: BytesPath, start: Optional[BytesPath] = ...) -> bytes: ...
@overload
@@ -137,28 +75,11 @@ def relpath(path: StrPath, start: Optional[StrPath] = ...) -> Text: ...
def samefile(f1: AnyPath, f2: AnyPath) -> bool: ...
def sameopenfile(fp1: int, fp2: int) -> bool: ...
def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ...
def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
if sys.version_info >= (3, 6):
@overload
def split(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ...
@overload
def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
@overload
def splitdrive(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ...
@overload
def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
@overload
def splitext(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ...
@overload
def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
else:
def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
if sys.version_info < (3, 7) and sys.platform == "win32":
if sys.platform == "win32":
def splitunc(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated
if sys.version_info < (3,):
def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ...
def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ...

View File

@@ -6,9 +6,6 @@ from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple,
_T = TypeVar("_T")
if sys.version_info >= (3, 6):
from builtins import _PathLike
# ----- os.path variables -----
supports_unicode_filenames: bool
# aliases (also in os)
@@ -25,67 +22,19 @@ defpath: str
devnull: str
# ----- os.path function stubs -----
if sys.version_info >= (3, 6):
# Overloads are necessary to work around python/mypy#3644.
@overload
def abspath(path: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def abspath(path: AnyStr) -> AnyStr: ...
@overload
def basename(p: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def basename(p: AnyStr) -> AnyStr: ...
@overload
def dirname(p: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def dirname(p: AnyStr) -> AnyStr: ...
@overload
def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def expanduser(path: AnyStr) -> AnyStr: ...
@overload
def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def expandvars(path: AnyStr) -> AnyStr: ...
@overload
def normcase(s: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def normcase(s: AnyStr) -> AnyStr: ...
@overload
def normpath(path: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def normpath(path: AnyStr) -> AnyStr: ...
if sys.platform == "win32":
@overload
def realpath(path: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def realpath(path: AnyStr) -> AnyStr: ...
else:
@overload
def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def realpath(filename: AnyStr) -> AnyStr: ...
def abspath(path: AnyStr) -> AnyStr: ...
def basename(p: AnyStr) -> AnyStr: ...
def dirname(p: AnyStr) -> AnyStr: ...
def expanduser(path: AnyStr) -> AnyStr: ...
def expandvars(path: AnyStr) -> AnyStr: ...
def normcase(s: AnyStr) -> AnyStr: ...
def normpath(path: AnyStr) -> AnyStr: ...
if sys.platform == "win32":
def realpath(path: AnyStr) -> AnyStr: ...
else:
def abspath(path: AnyStr) -> AnyStr: ...
def basename(p: AnyStr) -> AnyStr: ...
def dirname(p: AnyStr) -> AnyStr: ...
def expanduser(path: AnyStr) -> AnyStr: ...
def expandvars(path: AnyStr) -> AnyStr: ...
def normcase(s: AnyStr) -> AnyStr: ...
def normpath(path: AnyStr) -> AnyStr: ...
if sys.platform == "win32":
def realpath(path: AnyStr) -> AnyStr: ...
else:
def realpath(filename: AnyStr) -> AnyStr: ...
if sys.version_info >= (3, 6):
# In reality it returns str for sequences of StrPath and bytes for sequences
# of BytesPath, but mypy does not accept such a signature.
def commonpath(paths: Sequence[AnyPath]) -> Any: ...
elif sys.version_info >= (3, 5):
def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ...
def realpath(filename: AnyStr) -> AnyStr: ...
# NOTE: Empty lists results in '' (str) regardless of contained type.
# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes
@@ -105,31 +54,20 @@ def isdir(s: AnyPath) -> bool: ...
def islink(path: AnyPath) -> bool: ...
def ismount(path: AnyPath) -> bool: ...
if sys.version_info < (3, 0):
# Make sure signatures are disjunct, and allow combinations of bytes and unicode.
# (Since Python 2 allows that, too)
# Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in
# a type error.
@overload
def join(__p1: bytes, *p: bytes) -> bytes: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: bytes, __p2: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: Text, *p: AnyPath) -> Text: ...
elif sys.version_info >= (3, 6):
@overload
def join(a: StrPath, *paths: StrPath) -> Text: ...
@overload
def join(a: BytesPath, *paths: BytesPath) -> bytes: ...
else:
def join(a: AnyStr, *paths: AnyStr) -> AnyStr: ...
# Make sure signatures are disjunct, and allow combinations of bytes and unicode.
# (Since Python 2 allows that, too)
# Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in
# a type error.
@overload
def join(__p1: bytes, *p: bytes) -> bytes: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: bytes, __p2: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: Text, *p: AnyPath) -> Text: ...
@overload
def relpath(path: BytesPath, start: Optional[BytesPath] = ...) -> bytes: ...
@overload
@@ -137,28 +75,11 @@ def relpath(path: StrPath, start: Optional[StrPath] = ...) -> Text: ...
def samefile(f1: AnyPath, f2: AnyPath) -> bool: ...
def sameopenfile(fp1: int, fp2: int) -> bool: ...
def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ...
def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
if sys.version_info >= (3, 6):
@overload
def split(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ...
@overload
def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
@overload
def splitdrive(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ...
@overload
def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
@overload
def splitext(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ...
@overload
def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
else:
def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
if sys.version_info < (3, 7) and sys.platform == "win32":
if sys.platform == "win32":
def splitunc(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated
if sys.version_info < (3,):
def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ...
def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ...

85
stdlib/2/posixpath.pyi Normal file
View File

@@ -0,0 +1,85 @@
import os
import sys
from _typeshed import AnyPath, BytesPath, StrPath
from genericpath import exists as exists
from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, overload
_T = TypeVar("_T")
# ----- os.path variables -----
supports_unicode_filenames: bool
# aliases (also in os)
curdir: str
pardir: str
sep: str
if sys.platform == "win32":
altsep: str
else:
altsep: Optional[str]
extsep: str
pathsep: str
defpath: str
devnull: str
# ----- os.path function stubs -----
def abspath(path: AnyStr) -> AnyStr: ...
def basename(p: AnyStr) -> AnyStr: ...
def dirname(p: AnyStr) -> AnyStr: ...
def expanduser(path: AnyStr) -> AnyStr: ...
def expandvars(path: AnyStr) -> AnyStr: ...
def normcase(s: AnyStr) -> AnyStr: ...
def normpath(path: AnyStr) -> AnyStr: ...
if sys.platform == "win32":
def realpath(path: AnyStr) -> AnyStr: ...
else:
def realpath(filename: AnyStr) -> AnyStr: ...
# NOTE: Empty lists results in '' (str) regardless of contained type.
# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes
# So, fall back to Any
def commonprefix(m: Sequence[AnyPath]) -> Any: ...
def lexists(path: AnyPath) -> bool: ...
# These return float if os.stat_float_times() == True,
# but int is a subclass of float.
def getatime(filename: AnyPath) -> float: ...
def getmtime(filename: AnyPath) -> float: ...
def getctime(filename: AnyPath) -> float: ...
def getsize(filename: AnyPath) -> int: ...
def isabs(s: AnyPath) -> bool: ...
def isfile(path: AnyPath) -> bool: ...
def isdir(s: AnyPath) -> bool: ...
def islink(path: AnyPath) -> bool: ...
def ismount(path: AnyPath) -> bool: ...
# Make sure signatures are disjunct, and allow combinations of bytes and unicode.
# (Since Python 2 allows that, too)
# Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in
# a type error.
@overload
def join(__p1: bytes, *p: bytes) -> bytes: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: bytes, __p2: Text, *p: AnyPath) -> Text: ...
@overload
def join(__p1: Text, *p: AnyPath) -> Text: ...
@overload
def relpath(path: BytesPath, start: Optional[BytesPath] = ...) -> bytes: ...
@overload
def relpath(path: StrPath, start: Optional[StrPath] = ...) -> Text: ...
def samefile(f1: AnyPath, f2: AnyPath) -> bool: ...
def sameopenfile(fp1: int, fp2: int) -> bool: ...
def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ...
def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
if sys.platform == "win32":
def splitunc(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated
def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ...