Skip to content

Commit 2ec227e

Browse files
authored
fix: re.findall specific types
1 parent 58fdb3d commit 2ec227e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎stdlib/re.pyi‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ class Pattern(Generic[AnyStr]):
171171

172172
# return type depends on the number of groups in the pattern
173173
@overload
174-
def findall(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> list[Any]: ...
174+
def findall(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> list[str]: ...
175175
@overload
176-
def findall(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> list[Any]: ...
176+
def findall(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> list[bytes]: ...
177177
@overload
178178
def findall(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> list[AnyStr]: ...
179179

@@ -303,9 +303,9 @@ def split(
303303
) -> list[bytes | MaybeNone]: ...
304304

305305
@overload
306-
def findall(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> list[Any]: ...
306+
def findall(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> list[str]: ...
307307
@overload
308-
def findall(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> list[Any]: ...
308+
def findall(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> list[bytes]: ...
309309

310310
@overload
311311
def finditer(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Iterator[Match[str]]: ...

0 commit comments

Comments
 (0)