mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-12-03 14:02:19 +00:00
Use typing.Self throughout library
This commit is contained in:
@@ -59,6 +59,8 @@ from .utils import MISSING
|
||||
_log = logging.getLogger(__name__)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing_extensions import Self
|
||||
|
||||
from .ui.view import View
|
||||
from .embeds import Embed
|
||||
from .mentions import AllowedMentions
|
||||
@@ -100,7 +102,6 @@ if TYPE_CHECKING:
|
||||
|
||||
T = TypeVar('T')
|
||||
BE = TypeVar('BE', bound=BaseException)
|
||||
MU = TypeVar('MU', bound='MaybeUnlock')
|
||||
Response = Coroutine[Any, Any, T]
|
||||
|
||||
|
||||
@@ -287,7 +288,7 @@ class MaybeUnlock:
|
||||
self.lock: asyncio.Lock = lock
|
||||
self._unlock: bool = True
|
||||
|
||||
def __enter__(self: MU) -> MU:
|
||||
def __enter__(self) -> Self:
|
||||
return self
|
||||
|
||||
def defer(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user