Skip to content

Commit 5c5f3eb

Browse files
sre_compile: use TypeIs (#15263)
1 parent 3735956 commit 5c5f3eb

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

stdlib/sre_compile.pyi

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@ from re import Pattern
22
from sre_constants import *
33
from sre_constants import _NamedIntConstant
44
from sre_parse import SubPattern
5-
from typing import Any, Final, Literal, overload
6-
from typing_extensions import TypeGuard
5+
from typing import Any, Final
6+
from typing_extensions import TypeIs
77

88
MAXCODE: Final[int]
99

1010
def dis(code: list[_NamedIntConstant]) -> None: ...
11-
@overload
12-
def isstring(obj: str | bytes) -> Literal[True]: ...
13-
@overload
14-
def isstring(obj: object) -> TypeGuard[str | bytes]: ...
11+
def isstring(obj: object) -> TypeIs[str | bytes]: ...
1512
def compile(p: str | bytes | SubPattern, flags: int = 0) -> Pattern[Any]: ...

0 commit comments

Comments
 (0)