aboutsummaryrefslogtreecommitdiff
path: root/discord/raw_models.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-04-04 04:40:19 -0400
committerRapptz <[email protected]>2021-04-04 07:03:53 -0400
commit9d39b135f4f84239787b0901d06a4f370a82d4bb (patch)
tree8826845cfd47eafa5c9d2ef1fcbedd36382714f4 /discord/raw_models.py
parentBump minimum Python version to 3.8 (diff)
downloaddiscord.py-9d39b135f4f84239787b0901d06a4f370a82d4bb.tar.xz
discord.py-9d39b135f4f84239787b0901d06a4f370a82d4bb.zip
Modernize code to use f-strings
This also removes the encoding on the top, since Python 3 does it by default. It also changes some methods to use `yield from`.
Diffstat (limited to 'discord/raw_models.py')
-rw-r--r--discord/raw_models.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/discord/raw_models.py b/discord/raw_models.py
index 9be268ef..535a4fc8 100644
--- a/discord/raw_models.py
+++ b/discord/raw_models.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
"""
The MIT License (MIT)
@@ -26,8 +24,8 @@ DEALINGS IN THE SOFTWARE.
class _RawReprMixin:
def __repr__(self):
- value = ' '.join('%s=%r' % (attr, getattr(self, attr)) for attr in self.__slots__)
- return '<%s %s>' % (self.__class__.__name__, value)
+ value = ' '.join(f'{attr}={getattr(self, attr)!r}' for attr in self.__slots__)
+ return f'<{self.__class__.__name__} {value}>'
class RawMessageDeleteEvent(_RawReprMixin):
"""Represents the event payload for a :func:`on_raw_message_delete` event.