-
Notifications
You must be signed in to change notification settings - Fork 190
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
feat!: async cache and object rewrite #1185
base: master
Are you sure you want to change the base?
feat!: async cache and object rewrite #1185
Conversation
Signed-off-by: Alex Schoenhofen <alexanderschoenhofen@gmail.com>
nextcord/message.py
Outdated
|
||
def __repr__(self) -> str: | ||
name = self.__class__.__name__ | ||
return f"<{name} id={self.id} channel_id={self.channel_id} type={self.type}>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return f"<{name} id={self.id} channel_id={self.channel_id} type={self.type}>" | |
return f"<{name} id={self.id!r} channel_id={self.channel_id!r} type={self.type!r}>" |
if inspect.iscoroutinefunction(func): | ||
await func(data) | ||
else: | ||
func(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this just utils.maybe_coro
?
Signed-off-by: Alex Schoenhofen <alexanderschoenhofen@gmail.com>
4b5907c
to
7fde7e2
Compare
return self._members.pop((member_id, guild_id)) is not None | ||
|
||
async def get_member(self, member_id: int, guild_id: int) -> Optional[MemberData]: | ||
return self._members.get((member_id, guild_id), None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually None
is the default for dict.get
.
Signed-off-by: Alex Schoenhofen <alexanderschoenhofen@gmail.com>
a4bd804
to
a0058aa
Compare
Signed-off-by: Alex Schoenhofen <alexanderschoenhofen@gmail.com>
b92425e
to
b6c1af7
Compare
Signed-off-by: Alex Schoenhofen <alexanderschoenhofen@gmail.com>
Summary
This PR aims to
To say this is in progress is an understatement. It will likely be quite a while before anything here is relatively usable, let alone useful. This is being published so people can monitor this and raise issues about the architecture before I dive too far into the wrong direction.
This is a Code Change
task pyright
and fixed the relevant issues.