From 60d7a5daee3f190fcfbc6d4fd4130692440bc308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=85=E7=AB=8B=E4=B8=9A=EF=BC=88Chris=20Fu=EF=BC=89?= <17433201@qq.com> Date: Tue, 12 Nov 2024 09:43:36 +0800 Subject: [PATCH] Add `trackfd` onto `mmap.mmap` constructor --- stdlib/mmap.pyi | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/stdlib/mmap.pyi b/stdlib/mmap.pyi index 5be7f7b76ba1..f94e876237d1 100644 --- a/stdlib/mmap.pyi +++ b/stdlib/mmap.pyi @@ -34,9 +34,22 @@ class mmap: if sys.platform == "win32": def __init__(self, fileno: int, length: int, tagname: str | None = ..., access: int = ..., offset: int = ...) -> None: ... else: - def __init__( - self, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ... - ) -> None: ... + if sys.version_info >= (3, 13): + def __init__( + self, + fileno: int, + length: int, + flags: int = ..., + prot: int = ..., + access: int = ..., + offset: int = ..., + *, + trackfd: bool = True, + ) -> None: ... + else: + def __init__( + self, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ... + ) -> None: ... def close(self) -> None: ... def flush(self, offset: int = ..., size: int = ...) -> None: ...