-
-
Notifications
You must be signed in to change notification settings - Fork 475
refactor: ♻️ Refactor weird checks in CogMeta
and fix some typing and other qol things
#2730
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
Open
Paillat-dev
wants to merge
14
commits into
Pycord-Development:master
Choose a base branch
from
Paillat-dev:refactor/things
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
refactor: ♻️ Refactor weird checks in CogMeta
and fix some typing and other qol things
#2730
Paillat-dev
wants to merge
14
commits into
Pycord-Development:master
from
Paillat-dev:refactor/things
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34e8104
to
e127333
Compare
CogMeta
and fix some typingCogMeta
and fix some typing and other qol things
CogMeta
and fix some typing and other qol thingsCogMeta
and fix some typing and other qol things
f597e62
to
2787966
Compare
…typing` Deprecated since python 3.9, py-cord supports 3.9+
Signed-off-by: Paillat <me@paillat.dev>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Changes made:
SlashCommand.parent
BridgeCommand.__bridge__
which isTrue
BridgeCommand
by checking it has anadd_to
attribute (BridgeCommand
is the only class in py-cord that has such method) with aTypeGuard
that checks it has a__bridge__
attribute (which also makes this typed and that's cool)CogMeta.__cog_commands__
name_filter
to_name_filter
and define it outside of__new__
to avoid redefining it every time and also avoid assigning a lambda to a variable.bot_
orcog_
prefixes) to a helper function_validate_name_prefix
._process_attributes
. Simplify it by changing overengineered checks and simplifying dead code. Renameelem, value
toattr_name, attr_value
_update_command
, idem as above.Generator
&Mapping
fromcollections.abc
instead oftyping
(deprecated since python 3.9).Tested and fixed all the issues I found, but it would be nice if someone else could also test this to make sure I didn't miss anything.
Information
examples, ...).
Checklist
type: ignore
comments were used, a comment is also left explaining why.