Skip to content

Commit 9163c71

Browse files
authored
[Minor] Simplify some type hints in stubsabot (#9785)
We can use `typing_extensions.Self` now
1 parent e6e7fab commit 9163c71

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

scripts/stubsabot.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
from collections.abc import Iterator, Mapping, Sequence
2020
from dataclasses import dataclass
2121
from pathlib import Path
22-
from typing import Annotated, Any, ClassVar, NamedTuple, TypeVar
23-
from typing_extensions import TypeAlias
22+
from typing import Annotated, Any, ClassVar, NamedTuple
23+
from typing_extensions import Self, TypeAlias
2424

2525
import aiohttp
2626
import packaging.specifiers
@@ -29,11 +29,9 @@
2929
import tomlkit
3030
from termcolor import colored
3131

32-
ActionLevelSelf = TypeVar("ActionLevelSelf", bound="ActionLevel")
33-
3432

3533
class ActionLevel(enum.IntEnum):
36-
def __new__(cls: type[ActionLevelSelf], value: int, doc: str) -> ActionLevelSelf:
34+
def __new__(cls, value: int, doc: str) -> Self:
3735
member = int.__new__(cls, value)
3836
member._value_ = value
3937
member.__doc__ = doc

0 commit comments

Comments
 (0)