mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-29 07:06:55 +08:00
Use variable annotations everywhere (#2909)
This commit is contained in:
committed by
Sebastian Rittau
parent
b3c76aab49
commit
efb67946f8
@@ -3,9 +3,9 @@
|
||||
from typing import Union, Optional, Callable
|
||||
from xml.etree.ElementTree import Element
|
||||
|
||||
XINCLUDE = ... # type: str
|
||||
XINCLUDE_INCLUDE = ... # type: str
|
||||
XINCLUDE_FALLBACK = ... # type: str
|
||||
XINCLUDE: str
|
||||
XINCLUDE_INCLUDE: str
|
||||
XINCLUDE_FALLBACK: str
|
||||
|
||||
class FatalIncludeError(SyntaxError): ...
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
from typing import Pattern, Dict, Generator, Tuple, List, Union, TypeVar, Callable, Optional
|
||||
from xml.etree.ElementTree import Element
|
||||
|
||||
xpath_tokenizer_re = ... # type: Pattern
|
||||
xpath_tokenizer_re: Pattern
|
||||
|
||||
_token = Tuple[str, str]
|
||||
_next = Callable[[], _token]
|
||||
@@ -18,11 +18,11 @@ def prepare_descendant(next: _next, token: _token) -> _callback: ...
|
||||
def prepare_parent(next: _next, token: _token) -> _callback: ...
|
||||
def prepare_predicate(next: _next, token: _token) -> _callback: ...
|
||||
|
||||
ops = ... # type: Dict[str, Callable[[_next, _token], _callback]]
|
||||
ops: Dict[str, Callable[[_next, _token], _callback]]
|
||||
|
||||
class _SelectorContext:
|
||||
parent_map = ... # type: Dict[Element, Element]
|
||||
root = ... # type: Element
|
||||
parent_map: Dict[Element, Element]
|
||||
root: Element
|
||||
def __init__(self, root: Element) -> None: ...
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Any, Callable, Dict, Generator, IO, ItemsView, Iterable, Iter
|
||||
import io
|
||||
import sys
|
||||
|
||||
VERSION = ... # type: str
|
||||
VERSION: str
|
||||
|
||||
class ParseError(SyntaxError): ...
|
||||
|
||||
@@ -42,10 +42,10 @@ else:
|
||||
_tostring_result_type = bytes
|
||||
|
||||
class Element(MutableSequence[Element]):
|
||||
tag = ... # type: _str_result_type
|
||||
attrib = ... # type: Dict[_str_result_type, _str_result_type]
|
||||
text = ... # type: Optional[_str_result_type]
|
||||
tail = ... # type: Optional[_str_result_type]
|
||||
tag: _str_result_type
|
||||
attrib: Dict[_str_result_type, _str_result_type]
|
||||
text: Optional[_str_result_type]
|
||||
tail: Optional[_str_result_type]
|
||||
def __init__(self, tag: Union[_str_argument_type, Callable[..., Element]], attrib: Dict[_str_argument_type, _str_argument_type] = ..., **extra: _str_argument_type) -> None: ...
|
||||
def append(self, subelement: Element) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
@@ -86,10 +86,10 @@ def SubElement(parent: Element, tag: _str_argument_type, attrib: Dict[_str_argum
|
||||
def Comment(text: Optional[_str_argument_type] = ...) -> Element: ...
|
||||
def ProcessingInstruction(target: _str_argument_type, text: Optional[_str_argument_type] = ...) -> Element: ...
|
||||
|
||||
PI = ... # type: Callable[..., Element]
|
||||
PI: Callable[..., Element]
|
||||
|
||||
class QName:
|
||||
text = ... # type: str
|
||||
text: str
|
||||
def __init__(self, text_or_uri: _str_argument_type, tag: Optional[_str_argument_type] = ...) -> None: ...
|
||||
|
||||
|
||||
@@ -156,11 +156,11 @@ class TreeBuilder:
|
||||
def end(self, tag: _parser_input_type) -> Element: ...
|
||||
|
||||
class XMLParser:
|
||||
parser = ... # type: Any
|
||||
target = ... # type: TreeBuilder
|
||||
parser: Any
|
||||
target: TreeBuilder
|
||||
# TODO-what is entity used for???
|
||||
entity = ... # type: Any
|
||||
version = ... # type: str
|
||||
entity: Any
|
||||
version: str
|
||||
def __init__(self, html: int = ..., target: Optional[TreeBuilder] = ..., encoding: Optional[str] = ...) -> None: ...
|
||||
def doctype(self, name: str, pubid: str, system: str) -> None: ...
|
||||
def close(self) -> Element: ...
|
||||
|
||||
@@ -21,7 +21,7 @@ class SAXNotRecognizedException(SAXException): ...
|
||||
class SAXNotSupportedException(SAXException): ...
|
||||
class SAXReaderNotAvailable(SAXNotSupportedException): ...
|
||||
|
||||
default_parser_list = ... # type: List[str]
|
||||
default_parser_list: List[str]
|
||||
|
||||
def make_parser(parser_list: List[str] = ...) -> xml.sax.xmlreader.XMLReader: ...
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Any
|
||||
|
||||
version = ... # type: Any
|
||||
version: Any
|
||||
|
||||
class ErrorHandler:
|
||||
def error(self, exception): ...
|
||||
@@ -30,17 +30,17 @@ class DTDHandler:
|
||||
class EntityResolver:
|
||||
def resolveEntity(self, publicId, systemId): ...
|
||||
|
||||
feature_namespaces = ... # type: Any
|
||||
feature_namespace_prefixes = ... # type: Any
|
||||
feature_string_interning = ... # type: Any
|
||||
feature_validation = ... # type: Any
|
||||
feature_external_ges = ... # type: Any
|
||||
feature_external_pes = ... # type: Any
|
||||
all_features = ... # type: Any
|
||||
property_lexical_handler = ... # type: Any
|
||||
property_declaration_handler = ... # type: Any
|
||||
property_dom_node = ... # type: Any
|
||||
property_xml_string = ... # type: Any
|
||||
property_encoding = ... # type: Any
|
||||
property_interning_dict = ... # type: Any
|
||||
all_properties = ... # type: Any
|
||||
feature_namespaces: Any
|
||||
feature_namespace_prefixes: Any
|
||||
feature_string_interning: Any
|
||||
feature_validation: Any
|
||||
feature_external_ges: Any
|
||||
feature_external_pes: Any
|
||||
all_features: Any
|
||||
property_lexical_handler: Any
|
||||
property_declaration_handler: Any
|
||||
property_dom_node: Any
|
||||
property_xml_string: Any
|
||||
property_encoding: Any
|
||||
property_interning_dict: Any
|
||||
all_properties: Any
|
||||
|
||||
Reference in New Issue
Block a user