Skip to content
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

Add cls kwarg to commands.group decorator #2061

Closed
wants to merge 4 commits into from

Conversation

@Vexs
Copy link
Contributor

commented Apr 9, 2019

Summary

This is a purely aesthetic modification to the behavior of commands.Group decorator enabling slightly tidier usage of subclasses of command group.

Prior to this change, if you had subclassed command group, you would use the existing commands.Command decorator:
@commands.command(cls=group_subclass)
This is a slight readability discontinuity, compared to:
@commands.group(cls=group_subclass)

This also makes group slightly more consistent with command.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)
Add cls kwarg to commands.group decorator
Purely aesthetic/for readability
Show resolved Hide resolved discord/ext/commands/core.py Outdated
Show resolved Hide resolved discord/ext/commands/core.py Outdated
Show resolved Hide resolved discord/ext/commands/core.py Outdated
Show resolved Hide resolved discord/ext/commands/core.py Outdated

@Rapptz Rapptz added this to the v1.1 milestone Apr 10, 2019

Show resolved Hide resolved discord/ext/commands/core.py Outdated
Show resolved Hide resolved discord/ext/commands/core.py Outdated
Show resolved Hide resolved discord/ext/commands/core.py Outdated
Show resolved Hide resolved discord/ext/commands/core.py Outdated
@Rapptz

Rapptz approved these changes Apr 19, 2019

@Rapptz Rapptz added the rebased label Apr 19, 2019

@Rapptz Rapptz closed this Apr 19, 2019

@Vexs Vexs deleted the Vexs:commands_group_cls_kwarg branch Apr 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.