Skip to content

Commit 0db9084

Browse files
committed
stubtest
1 parent 12371f1 commit 0db9084

3 files changed

Lines changed: 25 additions & 15 deletions

File tree

stdlib/builtins.pyi

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -611,19 +611,25 @@ class str(Sequence[str]):
611611
def zfill(self: LiteralString, width: SupportsIndex, /) -> LiteralString: ...
612612
@overload
613613
def zfill(self, width: SupportsIndex, /) -> str: ... # type: ignore[misc]
614-
@staticmethod
615-
@overload
616-
def maketrans(
617-
x: (
618-
dict[int, _T]
619-
| dict[str, _T]
620-
| dict[str | int, _T]
621-
| frozendict[int, _T]
622-
| frozendict[str, _T]
623-
| frozendict[str | int, _T]
624-
),
625-
/,
626-
) -> dict[int, _T]: ...
614+
if sys.version_info >= (3, 15):
615+
@staticmethod
616+
@overload
617+
def maketrans(
618+
x: (
619+
dict[int, _T]
620+
| dict[str, _T]
621+
| dict[str | int, _T]
622+
| frozendict[int, _T]
623+
| frozendict[str, _T]
624+
| frozendict[str | int, _T]
625+
),
626+
/,
627+
) -> dict[int, _T]: ...
628+
else:
629+
@staticmethod
630+
@overload
631+
def maketrans(x: dict[int, _T] | dict[str, _T] | dict[str | int, _T], /) -> dict[int, _T]: ...
632+
627633
@staticmethod
628634
@overload
629635
def maketrans(x: str, y: str, /) -> dict[int, int]: ...

stdlib/opcode.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import sys
2-
from builtins import frozendict
2+
3+
if sys.version_info >= (3, 15):
4+
from builtins import frozendict
35
from typing import Final, Literal
46

57
__all__ = [

stdlib/posixpath.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import sys
22
from _typeshed import AnyOrLiteralStr, BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath
33
from collections.abc import Iterable
44
from genericpath import (
5-
ALL_BUT_LAST as ALL_BUT_LAST,
65
ALLOW_MISSING as ALLOW_MISSING,
76
_AllowMissingType,
87
commonprefix as commonprefix,
@@ -18,6 +17,9 @@ from genericpath import (
1817
samestat as samestat,
1918
)
2019

20+
if sys.version_info >= (3, 15):
21+
from genericpath import ALL_BUT_LAST as ALL_BUT_LAST
22+
2123
if sys.version_info >= (3, 13):
2224
from genericpath import isdevdrive as isdevdrive
2325
from os import PathLike

0 commit comments

Comments
 (0)