Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format with new lack preview style blank_line_after_body_in_stub_file #1

Draft
wants to merge 1 commit into
base: black-preview-style-current
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stdlib/_thread.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ if sys.version_info >= (3, 8):
class _ExceptHookArgs(structseq[Any], tuple[type[BaseException], BaseException | None, TracebackType | None, Thread | None]):
if sys.version_info >= (3, 10):
__match_args__: Final = ("exc_type", "exc_value", "exc_traceback", "thread")

@property
def exc_type(self) -> type[BaseException]: ...
@property
Expand Down
1 change: 1 addition & 0 deletions stdlib/fcntl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ if sys.platform != "win32":
I_STR: int
I_SWROPT: int
I_UNLINK: int

@overload
def fcntl(__fd: FileDescriptorLike, __cmd: int, __arg: int = 0) -> int: ...
@overload
Expand Down
1 change: 1 addition & 0 deletions stdlib/grp.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if sys.platform != "win32":
class struct_group(structseq[Any], tuple[str, str | None, int, list[str]]):
if sys.version_info >= (3, 10):
__match_args__: Final = ("gr_name", "gr_passwd", "gr_gid", "gr_mem")

@property
def gr_name(self) -> str: ...
@property
Expand Down
1 change: 1 addition & 0 deletions stdlib/http/server.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
extensions_map: dict[str, str]
if sys.version_info >= (3, 12):
index_pages: ClassVar[tuple[str, ...]]

def __init__(
self,
request: socketserver._RequestType,
Expand Down
1 change: 1 addition & 0 deletions stdlib/multiprocessing/reduction.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ class AbstractReducer(metaclass=ABCMeta):
sendfds = _sendfds
recvfds = _recvfds
DupFd = _DupFd

def __init__(self, *args: Unused) -> None: ...
8 changes: 8 additions & 0 deletions stdlib/os/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ class stat_result(structseq[float], tuple[int, int, int, int, int, int, int, flo
# More items may be added at the end by some implementations.
if sys.version_info >= (3, 10):
__match_args__: Final = ("st_mode", "st_ino", "st_dev", "st_nlink", "st_uid", "st_gid", "st_size")

@property
def st_mode(self) -> int: ... # protection bits,
@property
Expand Down Expand Up @@ -406,6 +407,7 @@ class statvfs_result(structseq[int], tuple[int, int, int, int, int, int, int, in
"f_flag",
"f_namemax",
)

@property
def f_bsize(self) -> int: ...
@property
Expand Down Expand Up @@ -448,6 +450,7 @@ def umask(__mask: int) -> int: ...
class uname_result(structseq[str], tuple[str, str, str, str, str]):
if sys.version_info >= (3, 10):
__match_args__: Final = ("sysname", "nodename", "release", "version", "machine")

@property
def sysname(self) -> str: ...
@property
Expand Down Expand Up @@ -641,6 +644,7 @@ if sys.platform != "win32":
RWF_SYNC: int
RWF_HIPRI: int
RWF_NOWAIT: int

@overload
def sendfile(out_fd: int, in_fd: int, offset: int | None, count: int) -> int: ...
@overload
Expand All @@ -660,6 +664,7 @@ if sys.platform != "win32":
class terminal_size(structseq[int], tuple[int, int]):
if sys.version_info >= (3, 10):
__match_args__: Final = ("columns", "lines")

@property
def columns(self) -> int: ...
@property
Expand Down Expand Up @@ -877,6 +882,7 @@ def system(command: StrOrBytesPath) -> int: ...
class times_result(structseq[float], tuple[float, float, float, float, float]):
if sys.version_info >= (3, 10):
__match_args__: Final = ("user", "system", "children_user", "children_system", "elapsed")

@property
def user(self) -> float: ...
@property
Expand Down Expand Up @@ -908,6 +914,7 @@ else:
class waitid_result(structseq[int], tuple[int, int, int, int, int]):
if sys.version_info >= (3, 10):
__match_args__: Final = ("si_pid", "si_uid", "si_signo", "si_status", "si_code")

@property
def si_pid(self) -> int: ...
@property
Expand Down Expand Up @@ -967,6 +974,7 @@ if sys.platform != "win32":
class sched_param(structseq[int], tuple[int]):
if sys.version_info >= (3, 10):
__match_args__: Final = ("sched_priority",)

def __new__(cls, sched_priority: int) -> Self: ...
@property
def sched_priority(self) -> int: ...
Expand Down
1 change: 1 addition & 0 deletions stdlib/pwd.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if sys.platform != "win32":
class struct_passwd(structseq[Any], tuple[str, str, int, int, str, str, str]):
if sys.version_info >= (3, 10):
__match_args__: Final = ("pw_name", "pw_passwd", "pw_uid", "pw_gid", "pw_gecos", "pw_dir", "pw_shell")

@property
def pw_name(self) -> str: ...
@property
Expand Down
2 changes: 2 additions & 0 deletions stdlib/resource.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ if sys.platform != "win32":
RLIMIT_RTTIME: int
RLIMIT_SIGPENDING: int
RUSAGE_THREAD: int

@final
class struct_rusage(
structseq[float], tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int]
Expand All @@ -48,6 +49,7 @@ if sys.platform != "win32":
"ru_nvcsw",
"ru_nivcsw",
)

@property
def ru_utime(self) -> float: ...
@property
Expand Down
2 changes: 2 additions & 0 deletions stdlib/signal.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,12 @@ else:
SIGRTMIN: Signals
if sys.version_info >= (3, 11):
SIGSTKFLT: Signals

@final
class struct_siginfo(structseq[int], tuple[int, int, int, int, int, int, int]):
if sys.version_info >= (3, 10):
__match_args__: Final = ("si_signo", "si_code", "si_errno", "si_pid", "si_uid", "si_status", "si_band")

@property
def si_signo(self) -> int: ...
@property
Expand Down
1 change: 1 addition & 0 deletions stdlib/spwd.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ if sys.platform != "win32":
"sp_expire",
"sp_flag",
)

@property
def sp_namp(self) -> str: ...
@property
Expand Down
1 change: 1 addition & 0 deletions stdlib/time.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ if sys.version_info >= (3, 9) and sys.platform == "linux":
class struct_time(structseq[Any | int], _TimeTuple):
if sys.version_info >= (3, 10):
__match_args__: Final = ("tm_year", "tm_mon", "tm_mday", "tm_hour", "tm_min", "tm_sec", "tm_wday", "tm_yday", "tm_isdst")

@property
def tm_year(self) -> int: ...
@property
Expand Down
2 changes: 2 additions & 0 deletions stdlib/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ class NamedTuple(tuple[Any, ...]):
# So we only add it to the stub on 3.12+.
if sys.version_info >= (3, 12):
__orig_bases__: ClassVar[tuple[Any, ...]]

@overload
def __init__(self, __typename: str, __fields: Iterable[tuple[str, Any]]) -> None: ...
@overload
Expand All @@ -893,6 +894,7 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta):
# so we only add it to the stub on 3.12+
if sys.version_info >= (3, 12):
__orig_bases__: ClassVar[tuple[Any, ...]]

def copy(self) -> typing_extensions.Self: ...
# Using Never so that only calls using mypy plugin hook that specialize the signature
# can go through.
Expand Down
1 change: 1 addition & 0 deletions stdlib/unittest/result.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class TestResult:
tb_locals: bool
if sys.version_info >= (3, 12):
collectedDurations: _DurationsType

def __init__(self, stream: TextIO | None = None, descriptions: bool | None = None, verbosity: int | None = None) -> None: ...
def printErrors(self) -> None: ...
def wasSuccessful(self) -> bool: ...
Expand Down