Skip to content

Commit 9a79266

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
1 parent f49fb1d commit 9a79266

715 files changed

Lines changed: 2482 additions & 5215 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.

lib/ts_utils/metadata.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
from collections.abc import Mapping
1414
from dataclasses import dataclass
1515
from pathlib import Path
16-
from typing import Annotated, Any, Final, NamedTuple, final
17-
from typing_extensions import TypeGuard
16+
from typing import Annotated, Any, Final, NamedTuple, TypeGuard, final
1817

1918
if sys.version_info >= (3, 11):
2019
import tomllib

lib/ts_utils/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
from collections.abc import Iterable, Mapping
1010
from pathlib import Path
1111
from types import MethodType
12-
from typing import TYPE_CHECKING, Any, Final, NamedTuple
13-
from typing_extensions import TypeAlias
12+
from typing import TYPE_CHECKING, Any, Final, NamedTuple, TypeAlias
1413

1514
import pathspec
1615
from packaging.requirements import Requirement

scripts/stubsabot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
from dataclasses import dataclass, field
2323
from http import HTTPStatus
2424
from pathlib import Path
25-
from typing import Annotated, Any, ClassVar, Literal, NamedTuple, TypedDict, TypeVar
26-
from typing_extensions import Self, TypeAlias
25+
from typing import Annotated, Any, ClassVar, Literal, NamedTuple, TypeAlias, TypedDict, TypeVar
26+
from typing_extensions import Self
2727

2828
if sys.version_info >= (3, 11):
2929
import tomllib

stdlib/__future__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing_extensions import TypeAlias
1+
from typing import TypeAlias
22

33
_VersionInfo: TypeAlias = tuple[int, int, int, str, int]
44

stdlib/_ast.pyi

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,19 @@ if sys.version_info >= (3, 12):
122122
if sys.version_info >= (3, 11):
123123
from ast import TryStar as TryStar
124124

125-
if sys.version_info >= (3, 10):
126-
from ast import (
127-
Match as Match,
128-
MatchAs as MatchAs,
129-
MatchClass as MatchClass,
130-
MatchMapping as MatchMapping,
131-
MatchOr as MatchOr,
132-
MatchSequence as MatchSequence,
133-
MatchSingleton as MatchSingleton,
134-
MatchStar as MatchStar,
135-
MatchValue as MatchValue,
136-
match_case as match_case,
137-
pattern as pattern,
138-
)
125+
from ast import (
126+
Match as Match,
127+
MatchAs as MatchAs,
128+
MatchClass as MatchClass,
129+
MatchMapping as MatchMapping,
130+
MatchOr as MatchOr,
131+
MatchSequence as MatchSequence,
132+
MatchSingleton as MatchSingleton,
133+
MatchStar as MatchStar,
134+
MatchValue as MatchValue,
135+
match_case as match_case,
136+
pattern as pattern,
137+
)
139138

140139
PyCF_ALLOW_TOP_LEVEL_AWAIT: Final = 8192
141140
PyCF_ONLY_AST: Final = 1024

stdlib/_asyncio.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ from asyncio.events import AbstractEventLoop
33
from collections.abc import Awaitable, Callable, Coroutine, Generator
44
from contextvars import Context
55
from types import FrameType, GenericAlias
6-
from typing import Any, Literal, TextIO, TypeVar
7-
from typing_extensions import Self, TypeAlias, disjoint_base
6+
from typing import Any, Literal, TextIO, TypeAlias, TypeVar
7+
from typing_extensions import Self, disjoint_base
88

99
_T = TypeVar("_T")
1010
_T_co = TypeVar("_T_co", covariant=True)

stdlib/_bisect.pyi

Lines changed: 62 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,68 @@
1-
import sys
21
from _typeshed import SupportsLenAndGetItem, SupportsRichComparisonT
32
from collections.abc import Callable, MutableSequence
43
from typing import TypeVar, overload
54

65
_T = TypeVar("_T")
76

8-
if sys.version_info >= (3, 10):
9-
@overload
10-
def bisect_left(
11-
a: SupportsLenAndGetItem[SupportsRichComparisonT],
12-
x: SupportsRichComparisonT,
13-
lo: int = 0,
14-
hi: int | None = None,
15-
*,
16-
key: None = None,
17-
) -> int: ...
18-
@overload
19-
def bisect_left(
20-
a: SupportsLenAndGetItem[_T],
21-
x: SupportsRichComparisonT,
22-
lo: int = 0,
23-
hi: int | None = None,
24-
*,
25-
key: Callable[[_T], SupportsRichComparisonT],
26-
) -> int: ...
27-
@overload
28-
def bisect_right(
29-
a: SupportsLenAndGetItem[SupportsRichComparisonT],
30-
x: SupportsRichComparisonT,
31-
lo: int = 0,
32-
hi: int | None = None,
33-
*,
34-
key: None = None,
35-
) -> int: ...
36-
@overload
37-
def bisect_right(
38-
a: SupportsLenAndGetItem[_T],
39-
x: SupportsRichComparisonT,
40-
lo: int = 0,
41-
hi: int | None = None,
42-
*,
43-
key: Callable[[_T], SupportsRichComparisonT],
44-
) -> int: ...
45-
@overload
46-
def insort_left(
47-
a: MutableSequence[SupportsRichComparisonT],
48-
x: SupportsRichComparisonT,
49-
lo: int = 0,
50-
hi: int | None = None,
51-
*,
52-
key: None = None,
53-
) -> None: ...
54-
@overload
55-
def insort_left(
56-
a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT]
57-
) -> None: ...
58-
@overload
59-
def insort_right(
60-
a: MutableSequence[SupportsRichComparisonT],
61-
x: SupportsRichComparisonT,
62-
lo: int = 0,
63-
hi: int | None = None,
64-
*,
65-
key: None = None,
66-
) -> None: ...
67-
@overload
68-
def insort_right(
69-
a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT]
70-
) -> None: ...
71-
72-
else:
73-
def bisect_left(
74-
a: SupportsLenAndGetItem[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None
75-
) -> int: ...
76-
def bisect_right(
77-
a: SupportsLenAndGetItem[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None
78-
) -> int: ...
79-
def insort_left(
80-
a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None
81-
) -> None: ...
82-
def insort_right(
83-
a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None
84-
) -> None: ...
7+
@overload
8+
def bisect_left(
9+
a: SupportsLenAndGetItem[SupportsRichComparisonT],
10+
x: SupportsRichComparisonT,
11+
lo: int = 0,
12+
hi: int | None = None,
13+
*,
14+
key: None = None,
15+
) -> int: ...
16+
@overload
17+
def bisect_left(
18+
a: SupportsLenAndGetItem[_T],
19+
x: SupportsRichComparisonT,
20+
lo: int = 0,
21+
hi: int | None = None,
22+
*,
23+
key: Callable[[_T], SupportsRichComparisonT],
24+
) -> int: ...
25+
@overload
26+
def bisect_right(
27+
a: SupportsLenAndGetItem[SupportsRichComparisonT],
28+
x: SupportsRichComparisonT,
29+
lo: int = 0,
30+
hi: int | None = None,
31+
*,
32+
key: None = None,
33+
) -> int: ...
34+
@overload
35+
def bisect_right(
36+
a: SupportsLenAndGetItem[_T],
37+
x: SupportsRichComparisonT,
38+
lo: int = 0,
39+
hi: int | None = None,
40+
*,
41+
key: Callable[[_T], SupportsRichComparisonT],
42+
) -> int: ...
43+
@overload
44+
def insort_left(
45+
a: MutableSequence[SupportsRichComparisonT],
46+
x: SupportsRichComparisonT,
47+
lo: int = 0,
48+
hi: int | None = None,
49+
*,
50+
key: None = None,
51+
) -> None: ...
52+
@overload
53+
def insort_left(
54+
a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT]
55+
) -> None: ...
56+
@overload
57+
def insort_right(
58+
a: MutableSequence[SupportsRichComparisonT],
59+
x: SupportsRichComparisonT,
60+
lo: int = 0,
61+
hi: int | None = None,
62+
*,
63+
key: None = None,
64+
) -> None: ...
65+
@overload
66+
def insort_right(
67+
a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT]
68+
) -> None: ...

stdlib/_codecs.pyi

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import codecs
22
import sys
33
from _typeshed import ReadableBuffer
44
from collections.abc import Callable
5-
from typing import Literal, final, overload, type_check_only
6-
from typing_extensions import TypeAlias
5+
from typing import Literal, TypeAlias, final, overload, type_check_only
76

87
# This type is not exposed; it is defined in unicodeobject.c
98
# At runtime it calls itself builtins.EncodingMap
@@ -17,10 +16,7 @@ _Handler: TypeAlias = Callable[[UnicodeError], tuple[str | bytes, int]]
1716
_SearchFunction: TypeAlias = Callable[[str], codecs.CodecInfo | None]
1817

1918
def register(search_function: _SearchFunction, /) -> None: ...
20-
21-
if sys.version_info >= (3, 10):
22-
def unregister(search_function: _SearchFunction, /) -> None: ...
23-
19+
def unregister(search_function: _SearchFunction, /) -> None: ...
2420
def register_error(errors: str, handler: _Handler, /) -> None: ...
2521
def lookup_error(name: str, /) -> _Handler: ...
2622

stdlib/_collections_abc.pyi

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,15 @@ class dict_keys(KeysView[_KT_co], Generic[_KT_co, _VT_co]): # undocumented
7575
__hash__: ClassVar[None] # type: ignore[assignment]
7676
if sys.version_info >= (3, 13):
7777
def isdisjoint(self, other: Iterable[_KT_co], /) -> bool: ...
78-
if sys.version_info >= (3, 10):
79-
@property
80-
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
78+
79+
@property
80+
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
8181

8282
@final
8383
class dict_values(ValuesView[_VT_co], Generic[_KT_co, _VT_co]): # undocumented
8484
def __reversed__(self) -> Iterator[_VT_co]: ...
85-
if sys.version_info >= (3, 10):
86-
@property
87-
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
85+
@property
86+
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
8887

8988
@final
9089
class dict_items(ItemsView[_KT_co, _VT_co]): # undocumented
@@ -93,9 +92,9 @@ class dict_items(ItemsView[_KT_co, _VT_co]): # undocumented
9392
__hash__: ClassVar[None] # type: ignore[assignment]
9493
if sys.version_info >= (3, 13):
9594
def isdisjoint(self, other: Iterable[tuple[_KT_co, _VT_co]], /) -> bool: ...
96-
if sys.version_info >= (3, 10):
97-
@property
98-
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
95+
96+
@property
97+
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
9998

10099
if sys.version_info >= (3, 12):
101100
@runtime_checkable

stdlib/_csv.pyi

Lines changed: 23 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import csv
22
import sys
33
from _typeshed import SupportsWrite
44
from collections.abc import Iterable
5-
from typing import Any, Final, Literal, type_check_only
6-
from typing_extensions import Self, TypeAlias, disjoint_base
5+
from typing import Any, Final, Literal, TypeAlias
6+
from typing_extensions import Self, disjoint_base
77

88
__version__: Final[str]
99

@@ -47,50 +47,31 @@ class Dialect:
4747
strict: bool = False,
4848
) -> Self: ...
4949

50-
if sys.version_info >= (3, 10):
51-
# This class calls itself _csv.reader.
52-
@disjoint_base
53-
class Reader:
54-
@property
55-
def dialect(self) -> Dialect: ...
56-
line_num: int
57-
def __iter__(self) -> Self: ...
58-
def __next__(self) -> list[str]: ...
59-
60-
# This class calls itself _csv.writer.
61-
@disjoint_base
62-
class Writer:
63-
@property
64-
def dialect(self) -> Dialect: ...
65-
if sys.version_info >= (3, 13):
66-
def writerow(self, row: Iterable[Any], /) -> Any: ...
67-
def writerows(self, rows: Iterable[Iterable[Any]], /) -> None: ...
68-
else:
69-
def writerow(self, row: Iterable[Any]) -> Any: ...
70-
def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ...
71-
72-
# For the return types below.
73-
# These aliases can be removed when typeshed drops support for 3.9.
74-
_reader = Reader
75-
_writer = Writer
76-
else:
77-
# This class is not exposed. It calls itself _csv.reader.
78-
@type_check_only
79-
class _reader:
80-
@property
81-
def dialect(self) -> Dialect: ...
82-
line_num: int
83-
def __iter__(self) -> Self: ...
84-
def __next__(self) -> list[str]: ...
50+
@disjoint_base
51+
class Reader:
52+
@property
53+
def dialect(self) -> Dialect: ...
54+
line_num: int
55+
def __iter__(self) -> Self: ...
56+
def __next__(self) -> list[str]: ...
8557

86-
# This class is not exposed. It calls itself _csv.writer.
87-
@type_check_only
88-
class _writer:
89-
@property
90-
def dialect(self) -> Dialect: ...
58+
# This class calls itself _csv.writer.
59+
@disjoint_base
60+
class Writer:
61+
@property
62+
def dialect(self) -> Dialect: ...
63+
if sys.version_info >= (3, 13):
64+
def writerow(self, row: Iterable[Any], /) -> Any: ...
65+
def writerows(self, rows: Iterable[Iterable[Any]], /) -> None: ...
66+
else:
9167
def writerow(self, row: Iterable[Any]) -> Any: ...
9268
def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ...
9369

70+
# For the return types below.
71+
# These aliases can be removed when typeshed drops support for 3.9.
72+
_reader = Reader
73+
_writer = Writer
74+
9475
def writer(
9576
fileobj: SupportsWrite[str],
9677
/,

0 commit comments

Comments
 (0)