mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 21:42:25 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
def lex(code, lexer): ...
|
||||
def format(tokens, formatter, outfile: Optional[Any] = ...): ...
|
||||
def highlight(code, lexer, formatter, outfile: Optional[Any] = ...): ...
|
||||
def format(tokens, formatter, outfile: Any | None = ...): ...
|
||||
def highlight(code, lexer, formatter, outfile: Any | None = ...): ...
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import argparse
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
def main_inner(parser, argns): ...
|
||||
|
||||
class HelpFormatter(argparse.HelpFormatter):
|
||||
def __init__(self, prog, indent_increment: int = ..., max_help_position: int = ..., width: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, prog, indent_increment: int = ..., max_help_position: int = ..., width: Any | None = ...) -> None: ...
|
||||
|
||||
def main(args=...): ...
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from collections.abc import Iterable, Iterator
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from pygments.lexer import Lexer
|
||||
from pygments.token import _TokenType
|
||||
|
||||
def apply_filters(stream, filters, lexer: Optional[Any] = ...): ...
|
||||
def apply_filters(stream, filters, lexer: Any | None = ...): ...
|
||||
def simplefilter(f): ...
|
||||
|
||||
class Filter:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from pygments.formatter import Formatter
|
||||
|
||||
@@ -31,9 +31,9 @@ class HtmlFormatter(Formatter):
|
||||
anchorlinenos: Any
|
||||
hl_lines: Any
|
||||
def __init__(self, **options) -> None: ...
|
||||
def get_style_defs(self, arg: Optional[Any] = ...): ...
|
||||
def get_token_style_defs(self, arg: Optional[Any] = ...): ...
|
||||
def get_background_style_defs(self, arg: Optional[Any] = ...): ...
|
||||
def get_style_defs(self, arg: Any | None = ...): ...
|
||||
def get_token_style_defs(self, arg: Any | None = ...): ...
|
||||
def get_background_style_defs(self, arg: Any | None = ...): ...
|
||||
def get_linenos_style_defs(self): ...
|
||||
def get_css_prefix(self, arg): ...
|
||||
def wrap(self, source, outfile): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from pygments.formatter import Formatter
|
||||
|
||||
@@ -9,7 +9,7 @@ class EscapeSequence:
|
||||
underline: Any
|
||||
italic: Any
|
||||
def __init__(
|
||||
self, fg: Optional[Any] = ..., bg: Optional[Any] = ..., bold: bool = ..., underline: bool = ..., italic: bool = ...
|
||||
self, fg: Any | None = ..., bg: Any | None = ..., bold: bool = ..., underline: bool = ..., italic: bool = ...
|
||||
) -> None: ...
|
||||
def escape(self, attrs): ...
|
||||
def color_string(self): ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from collections.abc import Iterable, Iterator, Sequence
|
||||
from typing import Any, Optional, Tuple
|
||||
from typing import Any, Tuple
|
||||
|
||||
from pygments.token import _TokenType
|
||||
from pygments.util import Future
|
||||
@@ -46,9 +46,9 @@ class combined(Tuple[Any]):
|
||||
|
||||
class _PseudoMatch:
|
||||
def __init__(self, start, text) -> None: ...
|
||||
def start(self, arg: Optional[Any] = ...): ...
|
||||
def end(self, arg: Optional[Any] = ...): ...
|
||||
def group(self, arg: Optional[Any] = ...): ...
|
||||
def start(self, arg: Any | None = ...): ...
|
||||
def end(self, arg: Any | None = ...): ...
|
||||
def group(self, arg: Any | None = ...): ...
|
||||
def groups(self): ...
|
||||
def groupdict(self): ...
|
||||
|
||||
@@ -72,7 +72,7 @@ class words(Future):
|
||||
def get(self): ...
|
||||
|
||||
class RegexLexerMeta(LexerMeta):
|
||||
def process_tokendef(cls, name, tokendefs: Optional[Any] = ...): ...
|
||||
def process_tokendef(cls, name, tokendefs: Any | None = ...): ...
|
||||
def get_tokendefs(cls): ...
|
||||
def __call__(cls, *args, **kwds): ...
|
||||
|
||||
@@ -86,7 +86,7 @@ class LexerContext:
|
||||
pos: Any
|
||||
end: Any
|
||||
stack: Any
|
||||
def __init__(self, text, pos, stack: Optional[Any] = ..., end: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, text, pos, stack: Any | None = ..., end: Any | None = ...) -> None: ...
|
||||
|
||||
class ExtendedRegexLexer(RegexLexer):
|
||||
def get_tokens_unprocessed(self, text: str | None = ..., context: LexerContext | None = ...) -> Iterator[tuple[int, _TokenType, str]]: ... # type: ignore
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from io import TextIOWrapper
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
split_path_re: Any
|
||||
doctype_lookup_re: Any
|
||||
@@ -9,10 +9,10 @@ xml_decl_re: Any
|
||||
class ClassNotFound(ValueError): ...
|
||||
class OptionError(Exception): ...
|
||||
|
||||
def get_choice_opt(options, optname, allowed, default: Optional[Any] = ..., normcase: bool = ...): ...
|
||||
def get_bool_opt(options, optname, default: Optional[Any] = ...): ...
|
||||
def get_int_opt(options, optname, default: Optional[Any] = ...): ...
|
||||
def get_list_opt(options, optname, default: Optional[Any] = ...): ...
|
||||
def get_choice_opt(options, optname, allowed, default: Any | None = ..., normcase: bool = ...): ...
|
||||
def get_bool_opt(options, optname, default: Any | None = ...): ...
|
||||
def get_int_opt(options, optname, default: Any | None = ...): ...
|
||||
def get_list_opt(options, optname, default: Any | None = ...): ...
|
||||
def docstring_headline(obj): ...
|
||||
def make_analysator(f): ...
|
||||
def shebang_matches(text, regex): ...
|
||||
|
||||
Reference in New Issue
Block a user