Skip to content

Commit 91ba0da

Browse files
authored
[glob] Deprecate glob0 and glob1 functions (#14477)
1 parent 8dc16bc commit 91ba0da

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

stdlib/glob.pyi

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,22 @@ import sys
22
from _typeshed import StrOrBytesPath
33
from collections.abc import Iterator, Sequence
44
from typing import AnyStr
5+
from typing_extensions import deprecated
56

67
__all__ = ["escape", "glob", "iglob"]
78

89
if sys.version_info >= (3, 13):
910
__all__ += ["translate"]
1011

11-
def glob0(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
12-
def glob1(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
12+
if sys.version_info >= (3, 10):
13+
@deprecated("Will be removed in Python 3.15; Use `glob.glob` and pass *root_dir* argument instead.")
14+
def glob0(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
15+
@deprecated("Will be removed in Python 3.15; Use `glob.glob` and pass *root_dir* argument instead.")
16+
def glob1(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
17+
18+
else:
19+
def glob0(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
20+
def glob1(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ...
1321

1422
if sys.version_info >= (3, 11):
1523
def glob(

0 commit comments

Comments
 (0)