Skip to content

Commit e2ce50b

Browse files
detleflagvanrossum
authored andcommitted
enable string arguments for start, end, and span methods of Match object
1 parent 0be5a11 commit e2ce50b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

stdlib/2.7/typing.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,9 @@ class Match(Generic[AnyStr]):
283283

284284
def groups(self, default: AnyStr = ...) -> Sequence[AnyStr]: ...
285285
def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr]: ...
286-
def start(self, group: int = ...) -> int: ...
287-
def end(self, group: int = ...) -> int: ...
288-
def span(self, group: int = ...) -> Tuple[int, int]: ...
286+
def start(self, group: Union[int, str] = ...) -> int: ...
287+
def end(self, group: Union[int, str] = ...) -> int: ...
288+
def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ...
289289

290290
class Pattern(Generic[AnyStr]):
291291
flags = 0

stdlib/3/typing.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,9 @@ class Match(Generic[AnyStr]):
360360

361361
def groups(self, default: AnyStr = ...) -> Sequence[AnyStr]: ...
362362
def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr]: ...
363-
def start(self, group: int = ...) -> int: ...
364-
def end(self, group: int = ...) -> int: ...
365-
def span(self, group: int = ...) -> Tuple[int, int]: ...
363+
def start(self, group: Union[int, str] = ...) -> int: ...
364+
def end(self, group: Union[int, str] = ...) -> int: ...
365+
def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ...
366366

367367
class Pattern(Generic[AnyStr]):
368368
flags = 0

0 commit comments

Comments
 (0)