Use the FileDescriptorOrPath alias consistently in the stdlib (#9513)

This commit is contained in:
Avasam
2023-01-12 13:14:48 -05:00
committed by GitHub
parent f64807a468
commit aad1a14890
12 changed files with 61 additions and 57 deletions

View File

@@ -1,6 +1,6 @@
import os
import sys
from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsRead, SupportsWrite
from _typeshed import BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath, SupportsRead, SupportsWrite
from collections.abc import Callable, Iterable, Sequence
from typing import Any, AnyStr, NamedTuple, Protocol, TypeVar, overload
from typing_extensions import TypeAlias
@@ -118,7 +118,7 @@ class _ntuple_diskusage(NamedTuple):
used: int
free: int
def disk_usage(path: int | StrOrBytesPath) -> _ntuple_diskusage: ...
def disk_usage(path: FileDescriptorOrPath) -> _ntuple_diskusage: ...
# While chown can be imported on Windows, it doesn't actually work;
# see https://bugs.python.org/issue33140. We keep it here because it's