Skip to content

Commit 6348a58

Browse files
authored
Import Match and Pattern from re, not typing (#8277)
1 parent 27db372 commit 6348a58

78 files changed

Lines changed: 142 additions & 90 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

stdlib/argparse.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22
from collections.abc import Callable, Generator, Iterable, Sequence
3-
from typing import IO, Any, Generic, NewType, NoReturn, Pattern, Protocol, TypeVar, overload
3+
from re import Pattern
4+
from typing import IO, Any, Generic, NewType, NoReturn, Protocol, TypeVar, overload
45
from typing_extensions import Literal, TypeAlias
56

67
__all__ = [

stdlib/configparser.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import sys
22
from _typeshed import StrOrBytesPath, SupportsWrite
33
from collections.abc import Callable, ItemsView, Iterable, Iterator, Mapping, MutableMapping, Sequence
4-
from typing import Any, ClassVar, Pattern, TypeVar, overload
4+
from re import Pattern
5+
from typing import Any, ClassVar, TypeVar, overload
56
from typing_extensions import Literal, TypeAlias
67

78
__all__ = [

stdlib/distutils/command/config.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from collections.abc import Sequence
2-
from typing import Any, Pattern
2+
from re import Pattern
3+
from typing import Any
34

45
from ..ccompiler import CCompiler
56
from ..cmd import Command

stdlib/distutils/filelist.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from collections.abc import Iterable
2-
from typing import Pattern, overload
2+
from re import Pattern
3+
from typing import overload
34
from typing_extensions import Literal
45

56
# class is entirely undocumented

stdlib/distutils/version.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from _typeshed import Self
22
from abc import abstractmethod
3-
from typing import Pattern
3+
from re import Pattern
44

55
class Version:
66
def __eq__(self, other: object) -> bool: ...

stdlib/email/_header_value_parser.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ from _typeshed import Self
33
from collections.abc import Iterable, Iterator
44
from email.errors import HeaderParseError, MessageDefect
55
from email.policy import Policy
6-
from typing import Any, Pattern
6+
from re import Pattern
7+
from typing import Any
78
from typing_extensions import Final
89

910
WSP: Final[set[str]]

stdlib/html/parser.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from _markupbase import ParserBase
2-
from typing import Pattern
2+
from re import Pattern
33

44
__all__ = ["HTMLParser"]
55

stdlib/http/cookiejar.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import sys
22
from _typeshed import StrPath
33
from collections.abc import Iterable, Iterator, Sequence
44
from http.client import HTTPResponse
5-
from typing import ClassVar, Pattern, TypeVar, overload
5+
from re import Pattern
6+
from typing import ClassVar, TypeVar, overload
67
from urllib.request import Request
78

89
__all__ = [

stdlib/imaplib.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import time
44
from _typeshed import Self
55
from builtins import list as _list # conflicts with a method named "list"
66
from collections.abc import Callable
7+
from re import Pattern
78
from socket import socket as _socket
89
from ssl import SSLContext, SSLSocket
910
from types import TracebackType
10-
from typing import IO, Any, Pattern
11+
from typing import IO, Any
1112
from typing_extensions import Literal, TypeAlias
1213

1314
__all__ = ["IMAP4", "IMAP4_stream", "Internaldate2tuple", "Int2AP", "ParseFlags", "Time2Internaldate", "IMAP4_SSL"]

stdlib/importlib/metadata/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ from email.message import Message
77
from importlib.abc import MetaPathFinder
88
from os import PathLike
99
from pathlib import Path
10-
from typing import Any, ClassVar, NamedTuple, Pattern, overload
10+
from re import Pattern
11+
from typing import Any, ClassVar, NamedTuple, overload
1112

1213
__all__ = [
1314
"Distribution",

0 commit comments

Comments
 (0)