Reformat code using black

Segments where readability was hampered were fixed by appropriate
format skipping directives. New code should hopefully be black
compatible. The moment they remove the -S option is probably the moment
I stop using black though.
This commit is contained in:
Rapptz
2022-02-20 06:29:41 -05:00
parent af8e74d327
commit 88b520b5ab
56 changed files with 738 additions and 289 deletions

View File

@ -34,9 +34,12 @@ if TYPE_CHECKING:
TypingT = TypeVar('TypingT', bound='Typing')
# fmt: off
__all__ = (
'Typing',
)
# fmt: on
def _typing_done_callback(fut: asyncio.Future) -> None:
# just retrieve any exception and call it a day
@ -45,6 +48,7 @@ def _typing_done_callback(fut: asyncio.Future) -> None:
except (asyncio.CancelledError, Exception):
pass
class Typing:
def __init__(self, messageable: Messageable) -> None:
self.loop: asyncio.AbstractEventLoop = messageable._state.loop
@ -67,7 +71,8 @@ class Typing:
self.task.add_done_callback(_typing_done_callback)
return self
def __exit__(self,
def __exit__(
self,
exc_type: Optional[Type[BaseException]],
exc_value: Optional[BaseException],
traceback: Optional[TracebackType],
@ -79,7 +84,8 @@ class Typing:
await channel._state.http.send_typing(channel.id)
return self.__enter__()
async def __aexit__(self,
async def __aexit__(
self,
exc_type: Optional[Type[BaseException]],
exc_value: Optional[BaseException],
traceback: Optional[TracebackType],