mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-08 02:40:58 +08:00
Define listdir in posix and import it in os. (#3258)
This commit is contained in:
committed by
Sebastian Rittau
parent
829c646d69
commit
3f8c2169d1
@@ -2,7 +2,7 @@
|
||||
# Ron Murawski <ron@horizonchess.com>
|
||||
|
||||
from io import TextIOWrapper as _TextIOWrapper
|
||||
from posix import times_result
|
||||
from posix import listdir as listdir, times_result
|
||||
import sys
|
||||
from typing import (
|
||||
Mapping, MutableMapping, Dict, List, Any, Tuple, IO, Iterable, Iterator, NoReturn, overload, Union, AnyStr,
|
||||
@@ -434,23 +434,6 @@ def link(
|
||||
follow_symlinks: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
@overload
|
||||
def listdir(path: Optional[str] = ...) -> List[str]: ...
|
||||
@overload
|
||||
def listdir(path: bytes) -> List[bytes]: ...
|
||||
@overload
|
||||
def listdir(path: int) -> List[str]: ...
|
||||
@overload
|
||||
def listdir(path: PathLike[str]) -> List[str]: ...
|
||||
else:
|
||||
@overload
|
||||
def listdir(path: Optional[str] = ...) -> List[str]: ...
|
||||
@overload
|
||||
def listdir(path: bytes) -> List[bytes]: ...
|
||||
@overload
|
||||
def listdir(path: int) -> List[str]: ...
|
||||
|
||||
def lstat(path: _PathType, *, dir_fd: Optional[int] = ...) -> stat_result: ...
|
||||
def mkdir(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
if sys.platform != 'win32':
|
||||
|
||||
Reference in New Issue
Block a user