From 1179983d727d57f14b5c53535bf95f6e5e326f30 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Fri, 17 May 2024 17:39:14 -0400 Subject: [PATCH 1/2] glob: add translate --- stdlib/glob.pyi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stdlib/glob.pyi b/stdlib/glob.pyi index 914ccc12ef1e..497171b3bc28 100644 --- a/stdlib/glob.pyi +++ b/stdlib/glob.pyi @@ -1,9 +1,11 @@ import sys from _typeshed import StrOrBytesPath -from collections.abc import Iterator +from collections.abc import Iterator, Sequence from typing import AnyStr __all__ = ["escape", "glob", "iglob"] +if sys.version_info >= (3, 13): + __all__ += ["translate"] def glob0(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ... def glob1(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ... @@ -40,3 +42,6 @@ else: def escape(pathname: AnyStr) -> AnyStr: ... def has_magic(s: str | bytes) -> bool: ... # undocumented + +if sys.version_info >= (3, 13): + def translate(pat: str, *, recursive: bool = False, include_hidden: bool=False, seps: Sequence[str] | None=None) -> str: ... From 52a8adcf56582754e7b8f79494d88a16367a3ddb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 21:41:08 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/glob.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/glob.pyi b/stdlib/glob.pyi index 497171b3bc28..9546c2201c3e 100644 --- a/stdlib/glob.pyi +++ b/stdlib/glob.pyi @@ -44,4 +44,6 @@ def escape(pathname: AnyStr) -> AnyStr: ... def has_magic(s: str | bytes) -> bool: ... # undocumented if sys.version_info >= (3, 13): - def translate(pat: str, *, recursive: bool = False, include_hidden: bool=False, seps: Sequence[str] | None=None) -> str: ... + def translate( + pat: str, *, recursive: bool = False, include_hidden: bool = False, seps: Sequence[str] | None = None + ) -> str: ...