Replace Incomplete | None = None in third party stubs (#14063)

This commit is contained in:
Sebastian Rittau
2025-05-15 21:37:43 +02:00
committed by GitHub
parent acc51542c9
commit 126768408a
488 changed files with 2259 additions and 4044 deletions
+1 -2
View File
@@ -1,9 +1,8 @@
import argparse
from _typeshed import Incomplete
def main_inner(parser, argns): ...
class HelpFormatter(argparse.HelpFormatter):
def __init__(self, prog, indent_increment: int = 2, max_help_position: int = 16, width: Incomplete | None = None) -> None: ...
def __init__(self, prog, indent_increment: int = 2, max_help_position: int = 16, width=None) -> None: ...
def main(args=...): ...
+1 -2
View File
@@ -1,11 +1,10 @@
from _typeshed import Incomplete
from collections.abc import Iterable, Iterator
from typing import Any
from pygments.lexer import Lexer
from pygments.token import _TokenType
def apply_filters(stream, filters, lexer: Incomplete | None = None): ...
def apply_filters(stream, filters, lexer=None): ...
def simplefilter(f): ...
class Filter:
+3 -4
View File
@@ -1,4 +1,3 @@
from _typeshed import Incomplete
from typing import Any, TypeVar
from pygments.formatter import Formatter
@@ -33,9 +32,9 @@ class HtmlFormatter(Formatter[_T]):
linespans: Any
anchorlinenos: Any
hl_lines: Any
def get_style_defs(self, arg: Incomplete | None = None): ...
def get_token_style_defs(self, arg: Incomplete | None = None): ...
def get_background_style_defs(self, arg: Incomplete | None = None): ...
def get_style_defs(self, arg=None): ...
def get_token_style_defs(self, arg=None): ...
def get_background_style_defs(self, arg=None): ...
def get_linenos_style_defs(self): ...
def get_css_prefix(self, arg): ...
def wrap(self, source): ...
@@ -1,4 +1,3 @@
from _typeshed import Incomplete
from typing import Any, TypeVar
from pygments.formatter import Formatter
@@ -11,14 +10,7 @@ class EscapeSequence:
bold: Any
underline: Any
italic: Any
def __init__(
self,
fg: Incomplete | None = None,
bg: Incomplete | None = None,
bold: bool = False,
underline: bool = False,
italic: bool = False,
) -> None: ...
def __init__(self, fg=None, bg=None, bold: bool = False, underline: bool = False, italic: bool = False) -> None: ...
def escape(self, attrs): ...
def color_string(self): ...
def true_color_string(self): ...
+5 -5
View File
@@ -49,9 +49,9 @@ class combined(tuple[Incomplete, ...]):
class _PseudoMatch:
def __init__(self, start, text) -> None: ...
def start(self, arg: Incomplete | None = None): ...
def end(self, arg: Incomplete | None = None): ...
def group(self, arg: Incomplete | None = None): ...
def start(self, arg=None): ...
def end(self, arg=None): ...
def group(self, arg=None): ...
def groups(self): ...
def groupdict(self): ...
@@ -75,7 +75,7 @@ class words(Future):
def get(self): ...
class RegexLexerMeta(LexerMeta):
def process_tokendef(cls, name, tokendefs: Incomplete | None = None): ...
def process_tokendef(cls, name, tokendefs=None): ...
def get_tokendefs(cls): ...
def __call__(cls, *args, **kwds): ...
@@ -89,7 +89,7 @@ class LexerContext:
pos: Incomplete
end: Incomplete
stack: Incomplete
def __init__(self, text, pos, stack: Incomplete | None = None, end: Incomplete | None = None) -> None: ...
def __init__(self, text, pos, stack=None, end=None) -> None: ...
class ExtendedRegexLexer(RegexLexer):
def get_tokens_unprocessed( # type: ignore[override]
+4 -5
View File
@@ -1,4 +1,3 @@
from _typeshed import Incomplete
from io import TextIOWrapper
from typing import Any
@@ -10,10 +9,10 @@ xml_decl_re: Any
class ClassNotFound(ValueError): ...
class OptionError(Exception): ...
def get_choice_opt(options, optname, allowed, default: Incomplete | None = None, normcase: bool = False): ...
def get_bool_opt(options, optname, default: Incomplete | None = None): ...
def get_int_opt(options, optname, default: Incomplete | None = None): ...
def get_list_opt(options, optname, default: Incomplete | None = None): ...
def get_choice_opt(options, optname, allowed, default=None, normcase: bool = False): ...
def get_bool_opt(options, optname, default=None): ...
def get_int_opt(options, optname, default=None): ...
def get_list_opt(options, optname, default=None): ...
def docstring_headline(obj): ...
def make_analysator(f): ...
def shebang_matches(text, regex): ...