mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Make more miscellaneous fields read-only, annotate _json.make_encoder (#7439)
This commit is contained in:
@@ -1049,15 +1049,21 @@ class ByteString(Sequence[int], metaclass=ABCMeta): ...
|
||||
|
||||
@_final
|
||||
class Match(Generic[AnyStr]):
|
||||
pos: int
|
||||
endpos: int
|
||||
lastindex: int | None
|
||||
lastgroup: str | None
|
||||
string: AnyStr
|
||||
@property
|
||||
def pos(self) -> int: ...
|
||||
@property
|
||||
def endpos(self) -> int: ...
|
||||
@property
|
||||
def lastindex(self) -> int | None: ...
|
||||
@property
|
||||
def lastgroup(self) -> str | None: ...
|
||||
@property
|
||||
def string(self) -> AnyStr: ...
|
||||
|
||||
# The regular expression object whose match() or search() method produced
|
||||
# this match instance.
|
||||
re: Pattern[AnyStr]
|
||||
@property
|
||||
def re(self) -> Pattern[AnyStr]: ...
|
||||
def expand(self, template: AnyStr) -> AnyStr: ...
|
||||
# group() returns "AnyStr" or "AnyStr | None", depending on the pattern.
|
||||
@overload
|
||||
@@ -1095,10 +1101,14 @@ class Match(Generic[AnyStr]):
|
||||
|
||||
@_final
|
||||
class Pattern(Generic[AnyStr]):
|
||||
flags: int
|
||||
groupindex: Mapping[str, int]
|
||||
groups: int
|
||||
pattern: AnyStr
|
||||
@property
|
||||
def flags(self) -> int: ...
|
||||
@property
|
||||
def groupindex(self) -> Mapping[str, int]: ...
|
||||
@property
|
||||
def groups(self) -> int: ...
|
||||
@property
|
||||
def pattern(self) -> AnyStr: ...
|
||||
def search(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> Match[AnyStr] | None: ...
|
||||
def match(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> Match[AnyStr] | None: ...
|
||||
def fullmatch(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> Match[AnyStr] | None: ...
|
||||
|
||||
Reference in New Issue
Block a user