Skip to content

[Minor] Simplify some type hints in stubsabot #9785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions scripts/stubsabot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from collections.abc import Iterator, Mapping, Sequence
from dataclasses import dataclass
from pathlib import Path
from typing import Annotated, Any, ClassVar, NamedTuple, TypeVar
from typing_extensions import TypeAlias
from typing import Annotated, Any, ClassVar, NamedTuple
from typing_extensions import Self, TypeAlias

import aiohttp
import packaging.specifiers
Expand All @@ -29,11 +29,9 @@
import tomlkit
from termcolor import colored

ActionLevelSelf = TypeVar("ActionLevelSelf", bound="ActionLevel")


class ActionLevel(enum.IntEnum):
def __new__(cls: type[ActionLevelSelf], value: int, doc: str) -> ActionLevelSelf:
def __new__(cls, value: int, doc: str) -> Self:
member = int.__new__(cls, value)
member._value_ = value
member.__doc__ = doc
Expand Down