mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-16 23:13:37 +08:00
Enable pyright for all Python 3 stubs (#5597)
* pyright: disable reportUnknownParameterType Unknown parameter types are preferred over Any annotations for incomplete stubs. Especially larger stubs are expected to be incomplete for some time and it would be a shame to lose the other pyright warnings for those stubs. * Also disable reportUnknownVariableType Fix problems with tkinter * Disable reportUnknownMemberType Fix pyright problems
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from typing import Any
|
||||
from typing import Any, List
|
||||
|
||||
class State(list):
|
||||
class State(List[Any]):
|
||||
def set(self, state) -> None: ...
|
||||
def reset(self) -> None: ...
|
||||
def isstate(self, state): ...
|
||||
|
||||
@@ -17,7 +17,7 @@ class BlockProcessor:
|
||||
class ListIndentProcessor(BlockProcessor):
|
||||
ITEM_TYPES: Any
|
||||
LIST_TYPES: Any
|
||||
INDENT_RE: Pattern
|
||||
INDENT_RE: Pattern[str]
|
||||
def __init__(self, *args) -> None: ...
|
||||
def create_item(self, parent, block) -> None: ...
|
||||
def get_level(self, parent, block): ...
|
||||
@@ -25,7 +25,7 @@ class ListIndentProcessor(BlockProcessor):
|
||||
class CodeBlockProcessor(BlockProcessor): ...
|
||||
|
||||
class BlockQuoteProcessor(BlockProcessor):
|
||||
RE: Pattern
|
||||
RE: Pattern[str]
|
||||
def clean(self, line): ...
|
||||
|
||||
class OListProcessor(BlockProcessor):
|
||||
@@ -33,26 +33,26 @@ class OListProcessor(BlockProcessor):
|
||||
STARTSWITH: str = ...
|
||||
LAZY_OL: bool = ...
|
||||
SIBLING_TAGS: Any
|
||||
RE: Pattern
|
||||
CHILD_RE: Pattern
|
||||
INDENT_RE: Pattern
|
||||
RE: Pattern[str]
|
||||
CHILD_RE: Pattern[str]
|
||||
INDENT_RE: Pattern[str]
|
||||
def __init__(self, parser) -> None: ...
|
||||
def get_items(self, block): ...
|
||||
|
||||
class UListProcessor(OListProcessor):
|
||||
TAG: str = ...
|
||||
RE: Pattern
|
||||
RE: Pattern[str]
|
||||
def __init__(self, parser) -> None: ...
|
||||
|
||||
class HashHeaderProcessor(BlockProcessor):
|
||||
RE: Pattern
|
||||
RE: Pattern[str]
|
||||
|
||||
class SetextHeaderProcessor(BlockProcessor):
|
||||
RE: Pattern
|
||||
RE: Pattern[str]
|
||||
|
||||
class HRProcessor(BlockProcessor):
|
||||
RE: str = ...
|
||||
SEARCH_RE: Pattern
|
||||
SEARCH_RE: Pattern[str]
|
||||
match: Any
|
||||
|
||||
class EmptyBlockProcessor(BlockProcessor): ...
|
||||
|
||||
@@ -4,7 +4,7 @@ from markdown.blockprocessors import BlockProcessor
|
||||
from markdown.extensions import Extension
|
||||
from markdown.inlinepatterns import InlineProcessor
|
||||
|
||||
ABBR_REF_RE: Pattern
|
||||
ABBR_REF_RE: Pattern[str]
|
||||
|
||||
class AbbrExtension(Extension): ...
|
||||
class AbbrPreprocessor(BlockProcessor): ...
|
||||
|
||||
@@ -6,9 +6,9 @@ from markdown.extensions import Extension
|
||||
class AdmonitionExtension(Extension): ...
|
||||
|
||||
class AdmonitionProcessor(BlockProcessor):
|
||||
CLASSNAME: str = ...
|
||||
CLASSNAME_TITLE: str = ...
|
||||
RE: Pattern
|
||||
CLASSNAME: str
|
||||
CLASSNAME_TITLE: str
|
||||
RE: Pattern[str]
|
||||
RE_SPACES: Any
|
||||
def get_class_and_title(self, match): ...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Pattern
|
||||
from typing import Pattern
|
||||
|
||||
from markdown.extensions import Extension
|
||||
from markdown.treeprocessors import Treeprocessor
|
||||
@@ -7,11 +7,11 @@ def get_attrs(str): ...
|
||||
def isheader(elem): ...
|
||||
|
||||
class AttrListTreeprocessor(Treeprocessor):
|
||||
BASE_RE: str = ...
|
||||
HEADER_RE: Pattern
|
||||
BLOCK_RE: Pattern
|
||||
INLINE_RE: Pattern
|
||||
NAME_RE: Pattern
|
||||
BASE_RE: str
|
||||
HEADER_RE: Pattern[str]
|
||||
BLOCK_RE: Pattern[str]
|
||||
INLINE_RE: Pattern[str]
|
||||
NAME_RE: Pattern[str]
|
||||
def assign_attrs(self, elem, attrs) -> None: ...
|
||||
def sanitize_name(self, name): ...
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from typing import Any, Pattern
|
||||
from typing import Pattern
|
||||
|
||||
from markdown.blockprocessors import BlockProcessor, ListIndentProcessor
|
||||
from markdown.extensions import Extension
|
||||
|
||||
class DefListProcessor(BlockProcessor):
|
||||
RE: Pattern
|
||||
NO_INDENT_RE: Pattern
|
||||
RE: Pattern[str]
|
||||
NO_INDENT_RE: Pattern[str]
|
||||
|
||||
class DefListIndentProcessor(ListIndentProcessor): ...
|
||||
class DefListExtension(Extension): ...
|
||||
|
||||
@@ -6,7 +6,7 @@ from markdown.preprocessors import Preprocessor
|
||||
class FencedCodeExtension(Extension): ...
|
||||
|
||||
class FencedBlockPreprocessor(Preprocessor):
|
||||
FENCED_BLOCK_RE: Pattern
|
||||
FENCED_BLOCK_RE: Pattern[str]
|
||||
CODE_WRAP: str = ...
|
||||
LANG_TAG: str = ...
|
||||
checked_for_codehilite: bool = ...
|
||||
|
||||
@@ -8,8 +8,8 @@ from markdown.treeprocessors import Treeprocessor
|
||||
|
||||
FN_BACKLINK_TEXT: Any
|
||||
NBSP_PLACEHOLDER: Any
|
||||
DEF_RE: Pattern
|
||||
TABBED_RE: Pattern
|
||||
DEF_RE: Pattern[str]
|
||||
TABBED_RE: Pattern[str]
|
||||
RE_REF_ID: Any
|
||||
|
||||
class FootnoteExtension(Extension):
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from typing import Any, Pattern
|
||||
from typing import Pattern
|
||||
|
||||
from markdown.extensions import Extension
|
||||
from markdown.treeprocessors import Treeprocessor
|
||||
|
||||
ATTR_RE: Pattern
|
||||
ATTR_RE: Pattern[str]
|
||||
|
||||
class LegacyAttrs(Treeprocessor):
|
||||
def handleAttributes(self, el, txt): ...
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
from markdown.extensions import Extension
|
||||
from markdown.inlinepatterns import UnderscoreProcessor
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from markdown.blockprocessors import BlockProcessor
|
||||
from markdown.extensions import Extension
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ from markdown.extensions import Extension
|
||||
from markdown.preprocessors import Preprocessor
|
||||
|
||||
log: Any
|
||||
META_RE: Pattern
|
||||
META_MORE_RE: Pattern
|
||||
BEGIN_RE: Pattern
|
||||
END_RE: Pattern
|
||||
META_RE: Pattern[str]
|
||||
META_MORE_RE: Pattern[str]
|
||||
BEGIN_RE: Pattern[str]
|
||||
END_RE: Pattern[str]
|
||||
|
||||
class MetaExtension(Extension):
|
||||
md: Any
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
from markdown.extensions import Extension
|
||||
|
||||
BR_RE: str
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from typing import Any, Pattern
|
||||
|
||||
from markdown.blockprocessors import OListProcessor, UListProcessor
|
||||
from markdown.extensions import Extension
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Pattern
|
||||
from typing import Any
|
||||
|
||||
from markdown.extensions import Extension
|
||||
from markdown.inlinepatterns import HtmlInlineProcessor
|
||||
|
||||
@@ -5,7 +5,7 @@ from markdown.treeprocessors import Treeprocessor
|
||||
|
||||
def slugify(value, separator): ...
|
||||
|
||||
IDCOUNT_RE: Pattern
|
||||
IDCOUNT_RE: Pattern[str]
|
||||
|
||||
def unique(id, ids): ...
|
||||
def get_name(el): ...
|
||||
|
||||
@@ -40,14 +40,14 @@ class Pattern:
|
||||
@property
|
||||
def markdown(self): ...
|
||||
def getCompiledRegExp(self): ...
|
||||
def handleMatch(self, m: Match) -> Optional[Union[str, Element]]: ...
|
||||
def handleMatch(self, m: Match[str]) -> Optional[Union[str, Element]]: ...
|
||||
def type(self): ...
|
||||
def unescape(self, text): ...
|
||||
|
||||
class InlineProcessor(Pattern):
|
||||
safe_mode: bool = ...
|
||||
def __init__(self, pattern, md: Optional[Any] = ...) -> None: ...
|
||||
def handleMatch(self, m: Match, data) -> Union[Tuple[Element, int, int], Tuple[None, None, None]]: ... # type: ignore
|
||||
def handleMatch(self, m: Match[str], data) -> Union[Tuple[Element, int, int], Tuple[None, None, None]]: ... # type: ignore
|
||||
|
||||
class SimpleTextPattern(Pattern): ...
|
||||
class SimpleTextInlineProcessor(InlineProcessor): ...
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
class Version:
|
||||
def __new__(cls, major, minor, micro, release: str = ..., pre: int = ..., post: int = ..., dev: int = ...): ...
|
||||
|
||||
|
||||
@@ -13,5 +13,5 @@ class RawHtmlPostprocessor(Postprocessor):
|
||||
class AndSubstitutePostprocessor(Postprocessor): ...
|
||||
|
||||
class UnescapePostprocessor(Postprocessor):
|
||||
RE: Pattern
|
||||
RE: Pattern[str]
|
||||
def unescape(self, m): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Iterable, List, Pattern
|
||||
from typing import Any, List, Pattern
|
||||
|
||||
from . import util
|
||||
|
||||
@@ -19,5 +19,5 @@ class HtmlBlockPreprocessor(Preprocessor):
|
||||
|
||||
class ReferencePreprocessor(Preprocessor):
|
||||
TITLE: str = ...
|
||||
RE: Pattern
|
||||
TITLE_RE: Pattern
|
||||
RE: Pattern[str]
|
||||
TITLE_RE: Pattern[str]
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
from typing import Any
|
||||
|
||||
def to_html_string(element): ...
|
||||
def to_xhtml_string(element): ...
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from collections import namedtuple
|
||||
from typing import Any, Optional, Pattern
|
||||
|
||||
PY37: Any
|
||||
@@ -8,10 +7,10 @@ STX: str
|
||||
ETX: str
|
||||
INLINE_PLACEHOLDER_PREFIX: Any
|
||||
INLINE_PLACEHOLDER: Any
|
||||
INLINE_PLACEHOLDER_RE: Pattern
|
||||
INLINE_PLACEHOLDER_RE: Pattern[str]
|
||||
AMP_SUBSTITUTE: Any
|
||||
HTML_PLACEHOLDER: Any
|
||||
HTML_PLACEHOLDER_RE: Pattern
|
||||
HTML_PLACEHOLDER_RE: Pattern[str]
|
||||
TAG_PLACEHOLDER: Any
|
||||
INSTALLED_EXTENSIONS: Any
|
||||
RTL_BIDI_RANGES: Any
|
||||
|
||||
Reference in New Issue
Block a user