mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,20 +1,5 @@
|
||||
import sys
|
||||
from typing import (
|
||||
Any,
|
||||
AnyStr,
|
||||
Callable,
|
||||
Generic,
|
||||
Iterable,
|
||||
Iterator,
|
||||
List,
|
||||
NamedTuple,
|
||||
Optional,
|
||||
Sequence,
|
||||
Tuple,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from typing import Any, AnyStr, Callable, Generic, Iterable, Iterator, List, NamedTuple, Sequence, Tuple, TypeVar, Union, overload
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -29,15 +14,13 @@ class Match(NamedTuple):
|
||||
|
||||
class SequenceMatcher(Generic[_T]):
|
||||
def __init__(
|
||||
self, isjunk: Optional[Callable[[_T], bool]] = ..., a: Sequence[_T] = ..., b: Sequence[_T] = ..., autojunk: bool = ...
|
||||
self, isjunk: Callable[[_T], bool] | None = ..., a: Sequence[_T] = ..., b: Sequence[_T] = ..., autojunk: bool = ...
|
||||
) -> None: ...
|
||||
def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ...
|
||||
def set_seq1(self, a: Sequence[_T]) -> None: ...
|
||||
def set_seq2(self, b: Sequence[_T]) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def find_longest_match(
|
||||
self, alo: int = ..., ahi: Optional[int] = ..., blo: int = ..., bhi: Optional[int] = ...
|
||||
) -> Match: ...
|
||||
def find_longest_match(self, alo: int = ..., ahi: int | None = ..., blo: int = ..., bhi: int | None = ...) -> Match: ...
|
||||
else:
|
||||
def find_longest_match(self, alo: int, ahi: int, blo: int, bhi: int) -> Match: ...
|
||||
def get_matching_blocks(self) -> List[Match]: ...
|
||||
@@ -60,7 +43,7 @@ def get_close_matches(
|
||||
) -> List[Sequence[_T]]: ...
|
||||
|
||||
class Differ:
|
||||
def __init__(self, linejunk: Optional[_JunkCallback] = ..., charjunk: Optional[_JunkCallback] = ...) -> None: ...
|
||||
def __init__(self, linejunk: _JunkCallback | None = ..., charjunk: _JunkCallback | None = ...) -> None: ...
|
||||
def compare(self, a: Sequence[str], b: Sequence[str]) -> Iterator[str]: ...
|
||||
|
||||
def IS_LINE_JUNK(line: str, pat: Any = ...) -> bool: ... # pat is undocumented
|
||||
@@ -86,16 +69,16 @@ def context_diff(
|
||||
lineterm: str = ...,
|
||||
) -> Iterator[str]: ...
|
||||
def ndiff(
|
||||
a: Sequence[str], b: Sequence[str], linejunk: Optional[_JunkCallback] = ..., charjunk: Optional[_JunkCallback] = ...
|
||||
a: Sequence[str], b: Sequence[str], linejunk: _JunkCallback | None = ..., charjunk: _JunkCallback | None = ...
|
||||
) -> Iterator[str]: ...
|
||||
|
||||
class HtmlDiff(object):
|
||||
def __init__(
|
||||
self,
|
||||
tabsize: int = ...,
|
||||
wrapcolumn: Optional[int] = ...,
|
||||
linejunk: Optional[_JunkCallback] = ...,
|
||||
charjunk: Optional[_JunkCallback] = ...,
|
||||
wrapcolumn: int | None = ...,
|
||||
linejunk: _JunkCallback | None = ...,
|
||||
charjunk: _JunkCallback | None = ...,
|
||||
) -> None: ...
|
||||
def make_file(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user