Import Match and Pattern from re, not typing (#8277)

This commit is contained in:
Alex Waygood
2022-07-12 14:32:48 +01:00
committed by GitHub
parent 27db37240a
commit 6348a58b8b
78 changed files with 142 additions and 90 deletions

View File

@@ -1,7 +1,8 @@
from collections.abc import Iterable
from datetime import timedelta
from logging import Logger
from typing import Any, Pattern, TypeVar, overload
from re import Pattern
from typing import Any, TypeVar, overload
from typing_extensions import TypeAlias, TypedDict
_IterableT = TypeVar("_IterableT", bound=Iterable[Any])

View File

@@ -1,7 +1,8 @@
from collections.abc import Callable, Iterable
from datetime import timedelta
from logging import Logger
from typing import Any, Pattern
from re import Pattern
from typing import Any
from typing_extensions import ParamSpec
_P = ParamSpec("_P")

View File

@@ -1,4 +1,5 @@
from typing import Any, Pattern
from re import Pattern
from typing import Any
from sqlalchemy.ext.declarative import DeclarativeMeta

View File

@@ -1,5 +1,6 @@
from logging import Logger
from typing import Any, Match, Pattern
from re import Match, Pattern
from typing import Any
from xml.etree.ElementTree import Element
from markdown import Markdown

View File

@@ -1,4 +1,5 @@
from typing import Any, Pattern
from re import Pattern
from typing import Any
from markdown.blockprocessors import BlockProcessor
from markdown.extensions import Extension

View File

@@ -1,4 +1,5 @@
from typing import Any, Pattern
from re import Pattern
from typing import Any
from markdown.blockprocessors import BlockProcessor
from markdown.extensions import Extension

View File

@@ -1,4 +1,4 @@
from typing import Pattern
from re import Pattern
from markdown.extensions import Extension
from markdown.treeprocessors import Treeprocessor

View File

@@ -1,4 +1,4 @@
from typing import Pattern
from re import Pattern
from markdown.blockprocessors import BlockProcessor, ListIndentProcessor
from markdown.extensions import Extension

View File

@@ -1,4 +1,5 @@
from typing import Any, Pattern
from re import Pattern
from typing import Any
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor

View File

@@ -1,4 +1,5 @@
from typing import Any, Pattern
from re import Pattern
from typing import Any
from markdown.extensions import Extension
from markdown.inlinepatterns import InlineProcessor

View File

@@ -1,4 +1,4 @@
from typing import Pattern
from re import Pattern
from markdown.extensions import Extension
from markdown.treeprocessors import Treeprocessor

View File

@@ -1,4 +1,5 @@
from typing import Any, Pattern
from re import Pattern
from typing import Any
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor

View File

@@ -1,4 +1,5 @@
from typing import Any, Pattern
from re import Pattern
from typing import Any
from markdown.extensions import Extension
from markdown.treeprocessors import Treeprocessor

View File

@@ -1,5 +1,6 @@
import typing
from typing import Any, ClassVar, Match
import re
from re import Match
from typing import Any, ClassVar
from xml.etree.ElementTree import Element
def build_inlinepatterns(md, **kwargs): ...
@@ -94,7 +95,7 @@ class LinkInlineProcessor(InlineProcessor):
class ImageInlineProcessor(LinkInlineProcessor): ...
class ReferenceInlineProcessor(LinkInlineProcessor):
NEWLINE_CLEANUP_RE: ClassVar[typing.Pattern[str]]
NEWLINE_CLEANUP_RE: ClassVar[re.Pattern[str]]
def evalId(self, data, index, text): ...
def makeTag(self, href, title, text): ...

View File

@@ -1,4 +1,5 @@
from typing import Any, Pattern
from re import Pattern
from typing import Any
from . import util

View File

@@ -1,4 +1,5 @@
from typing import Any, Pattern
from re import Pattern
from typing import Any
from . import util

View File

@@ -1,4 +1,5 @@
from typing import Any, Pattern, overload
from re import Pattern
from typing import Any, overload
PY37: bool
__deprecated__: dict[str, tuple[str, Any]]

View File

@@ -1,5 +1,6 @@
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
from typing import Any, Pattern, TypeVar, overload
from re import Pattern
from typing import Any, TypeVar, overload
from typing_extensions import TypeAlias
from . import resolver as resolver # Help mypy a bit; this is implied by loader and dumper

View File

@@ -1,5 +1,6 @@
from collections.abc import Callable
from typing import Any, Pattern, TypeVar
from re import Pattern
from typing import Any, TypeVar
from typing_extensions import TypeAlias
from yaml.error import MarkedYAMLError

View File

@@ -1,6 +1,7 @@
from _typeshed import Self
from collections.abc import Callable, Iterable, Iterator
from typing import Any, Generic, Pattern, TypeVar, overload
from re import Pattern
from typing import Any, Generic, TypeVar, overload
from typing_extensions import TypeAlias
from . import BeautifulSoup

View File

@@ -1,5 +1,6 @@
from collections.abc import Container, Iterable, MutableMapping
from typing import Any, Pattern, Protocol
from re import Pattern
from typing import Any, Protocol
from typing_extensions import TypeAlias
from .html5lib_shim import Filter

View File

@@ -1,5 +1,6 @@
from collections.abc import Callable, Container, Iterable
from typing import Any, Pattern
from re import Pattern
from typing import Any
from typing_extensions import TypeAlias
from .css_sanitizer import CSSSanitizer

View File

@@ -1,5 +1,5 @@
from logging import Logger
from typing import Pattern
from re import Pattern
from typing_extensions import TypedDict
class _FinalResultType(TypedDict):

View File

@@ -1,8 +1,9 @@
import sys
from _typeshed import SupportsWrite
from collections.abc import Callable, Sequence
from re import Pattern
from types import TracebackType
from typing import Any, Pattern, TextIO
from typing import Any, TextIO
from typing_extensions import TypeAlias
if sys.platform == "win32":

View File

@@ -1,7 +1,8 @@
import collections
from collections.abc import Callable, Iterable, Iterator
from datetime import datetime
from typing import ClassVar, Pattern, overload
from re import Pattern
from typing import ClassVar, overload
from typing_extensions import Literal, TypeAlias
from dateparser import _Settings

View File

@@ -1,12 +1,7 @@
import sys
from re import Pattern
from dateparser.conf import Settings
if sys.version_info >= (3, 8):
from re import Pattern
else:
from typing import Pattern
DIGIT_GROUP_PATTERN: Pattern[str]
NUMERAL_PATTERN: Pattern[str]

View File

@@ -2,7 +2,8 @@ from builtins import dict as _dict # alias to avoid conflicts with attribute na
from collections.abc import Callable, Iterator
from contextlib import _GeneratorContextManager
from inspect import getfullargspec as getfullargspec, iscoroutinefunction as iscoroutinefunction
from typing import Any, Pattern, TypeVar
from re import Pattern
from typing import Any, TypeVar
from typing_extensions import ParamSpec
_C = TypeVar("_C", bound=Callable[..., Any])

View File

@@ -1,5 +1,5 @@
from collections.abc import Callable
from typing import Pattern
from re import Pattern
from typing_extensions import Literal, TypedDict
_DEFAULT_DELIMITER: str

View File

@@ -7,7 +7,7 @@ from typing import Any
if sys.version_info >= (3, 8):
from re import Pattern
else:
from typing import Pattern
from re import Pattern
entry_point_pattern: Pattern[str]
file_in_zip_pattern: Pattern[str]

View File

@@ -1,6 +1,7 @@
import datetime
from re import Pattern
from types import TracebackType
from typing import Any, NamedTuple, Pattern
from typing import Any, NamedTuple
class SizeUnit(NamedTuple):
divider: int

View File

@@ -1,6 +1,7 @@
from _typeshed import Self
from collections.abc import Iterable
from typing import IO, Any, Pattern
from re import Pattern
from typing import IO, Any
from paramiko.ssh_exception import ConfigParseError as ConfigParseError, CouldNotCanonicalize as CouldNotCanonicalize

View File

@@ -1,5 +1,6 @@
from _typeshed import Self
from typing import IO, Pattern
from re import Pattern
from typing import IO
from paramiko.message import Message

View File

@@ -1,6 +1,7 @@
import collections.abc
from collections.abc import Callable, Mapping
from typing import Any, Pattern, Union
from re import Pattern
from typing import Any, Union
from typing_extensions import TypeAlias
from parsimonious.exceptions import ParseError

View File

@@ -1,5 +1,6 @@
from collections.abc import Callable, Iterator, Sequence
from typing import Any, Match, NoReturn, TypeVar
from re import Match
from typing import Any, NoReturn, TypeVar
from parsimonious.exceptions import VisitationError as VisitationError
from parsimonious.expressions import Expression

View File

@@ -1,6 +1,6 @@
from _typeshed import StrPath
from collections.abc import Iterator
from typing import Match
from re import Match
class Store:
def __init__(

View File

@@ -1,5 +1,6 @@
from collections.abc import Iterable, Iterator, Sequence
from typing import Any, Pattern
from re import Pattern
from typing import Any
from pyflakes.reporter import Reporter

View File

@@ -1,8 +1,9 @@
import ast
import sys
from collections.abc import Callable, Iterable, Iterator
from re import Pattern
from tokenize import TokenInfo
from typing import Any, ClassVar, Pattern, TypeVar, overload
from typing import Any, ClassVar, TypeVar, overload
from typing_extensions import Literal, ParamSpec, TypeAlias
from pyflakes.messages import Message

View File

@@ -2,8 +2,9 @@ import threading
from _typeshed import Incomplete, Self, SupportsItems
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
from datetime import datetime, timedelta
from re import Pattern
from types import TracebackType
from typing import Any, ClassVar, Generic, Pattern, TypeVar, overload
from typing import Any, ClassVar, Generic, TypeVar, overload
from typing_extensions import Literal, TypeAlias
from redis import RedisError

View File

@@ -1,4 +1,5 @@
from typing import Any, Match
from re import Match
from typing import Any
class JSONDecoder:
def __init__(self, **kwargs: Any) -> None: ...

View File

@@ -9,7 +9,8 @@ from collections.abc import Callable, ItemsView, Iterable, Iterator as _Iterator
from functools import wraps as wraps
from importlib.util import spec_from_loader as spec_from_loader
from io import BytesIO as BytesIO, StringIO as StringIO
from typing import Any, AnyStr, NoReturn, Pattern, TypeVar, overload
from re import Pattern
from typing import Any, AnyStr, NoReturn, TypeVar, overload
from typing_extensions import Literal
from . import moves as moves

View File

@@ -1,7 +1,8 @@
from _typeshed import SupportsRead
from collections.abc import Callable, MutableMapping
from pathlib import PurePath
from typing import Any, Generic, Pattern, TypeVar, overload
from re import Pattern
from typing import Any, Generic, TypeVar, overload
from typing_extensions import TypeAlias
_MutableMappingT = TypeVar("_MutableMappingT", bound=MutableMapping[str, Any])

View File

@@ -1,6 +1,7 @@
from _typeshed import Incomplete
from collections.abc import Callable
from typing import Pattern, Protocol, TypeVar
from re import Pattern
from typing import Protocol, TypeVar
from typing_extensions import ParamSpec
CUR_OS: str

View File

@@ -1,6 +1,7 @@
from collections.abc import Mapping, Sequence
from io import BytesIO
from typing import Any, Pattern
from re import Pattern
from typing import Any
from waitress.adjustments import Adjustments
from waitress.receiver import ChunkedReceiver, FixedStreamReceiver

View File

@@ -1,6 +1,7 @@
from collections.abc import Callable, Sequence
from io import TextIOWrapper
from typing import Any, Pattern
from re import Pattern
from typing import Any
HELP: str
RUNNER_PATTERN: Pattern[Any]

View File

@@ -1,7 +1,8 @@
from _typeshed.wsgi import StartResponse
from collections.abc import Iterator, Mapping, Sequence
from logging import Logger
from typing import Any, Match, Pattern
from re import Match, Pattern
from typing import Any
logger: Logger
queue_logger: Logger

View File

@@ -1,5 +1,6 @@
from collections.abc import Iterable, Iterator
from typing import NamedTuple, Pattern
from re import Pattern
from typing import NamedTuple
from . import exceptions as exceptions
from .snippets import findall_regex as findall_regex, split_by_regex as split_by_regex

View File

@@ -1,5 +1,5 @@
from collections.abc import Sequence
from typing import Pattern
from re import Pattern
def remove(path: str) -> None: ...
def findall_regex(items: Sequence[str], regex: Pattern[str]) -> list[int]: ...

View File

@@ -1,6 +1,7 @@
from collections.abc import Iterable, Mapping
from decimal import Decimal
from typing import Any, Pattern
from re import Pattern
from typing import Any
from typing_extensions import Literal, NotRequired, TypedDict
from .adjacency_graphs import _Graph

View File

@@ -1,6 +1,6 @@
from collections.abc import Iterable
from decimal import Decimal
from typing import Pattern
from re import Pattern
from typing_extensions import TypedDict
from .adjacency_graphs import _Graph