mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 19:01:15 +08:00
statvfs_result: type structseq better (#4587)
Fixes #4572 Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -25,7 +25,6 @@ from typing import (
|
||||
List,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
NamedTuple,
|
||||
NoReturn,
|
||||
Optional,
|
||||
Sequence,
|
||||
@@ -304,9 +303,16 @@ else:
|
||||
def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
_Tuple10Int = Tuple[int, int, int, int, int, int, int, int, int, int]
|
||||
_Tuple11Int = Tuple[int, int, int, int, int, int, int, int, int, int, int]
|
||||
if sys.version_info >= (3, 7):
|
||||
# f_fsid was added in https://github.com/python/cpython/pull/4571
|
||||
class statvfs_result(NamedTuple): # Unix only
|
||||
class statvfs_result(_Tuple10Int): # Unix only
|
||||
def __new__(cls, seq: Union[_Tuple10Int, _Tuple11Int], dict: Dict[str, int] = ...) -> statvfs_result: ...
|
||||
n_fields: int
|
||||
n_sequence_fields: int
|
||||
n_unnamed_fields: int
|
||||
|
||||
f_bsize: int
|
||||
f_frsize: int
|
||||
f_blocks: int
|
||||
@@ -317,9 +323,13 @@ if sys.platform != "win32":
|
||||
f_favail: int
|
||||
f_flag: int
|
||||
f_namemax: int
|
||||
f_fsid: int
|
||||
f_fsid: int = ...
|
||||
else:
|
||||
class statvfs_result(NamedTuple): # Unix only
|
||||
class statvfs_result(_Tuple10Int): # Unix only
|
||||
n_fields: int
|
||||
n_sequence_fields: int
|
||||
n_unnamed_fields: int
|
||||
|
||||
f_bsize: int
|
||||
f_frsize: int
|
||||
f_blocks: int
|
||||
|
||||
Reference in New Issue
Block a user