Skip to content

Commit 17a6a0f

Browse files
authored
chore: comment on re.findall
1 parent 2ec227e commit 17a6a0f

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎stdlib/re.pyi‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ class Pattern(Generic[AnyStr]):
169169
@overload
170170
def split(self, string: AnyStr, maxsplit: int = 0) -> list[AnyStr | MaybeNone]: ...
171171

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

@@ -302,10 +302,11 @@ def split(
302302
pattern: bytes | Pattern[bytes], string: ReadableBuffer, maxsplit: int = 0, flags: _FlagsType = 0
303303
) -> list[bytes | MaybeNone]: ...
304304

305+
# return type is either list[str/bytes] or list[tuple[str/bytes, ...]]
305306
@overload
306-
def findall(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> list[str]: ...
307+
def findall(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> list[Any]: ...
307308
@overload
308-
def findall(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> list[bytes]: ...
309+
def findall(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> list[Any]: ...
309310

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

0 commit comments

Comments
 (0)