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

feat(app-cmds): add support for 3.10 unions #853

Merged
merged 4 commits into from Oct 30, 2022

Conversation

alentoghostflame
Copy link
Collaborator

Signed-off-by: Alex Schoenhofen alexanderschoenhofen@gmail.com

Summary

Adds PEP 604 support to application commands, allowing the Python 3.10 style of unions.
Example: arg1: str | None

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
    • I have run task pyright and fixed the relevant issues.
  • 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, ...)

alentoghostflame and others added 2 commits October 19, 2022 19:10
Signed-off-by: Alex Schoenhofen <alexanderschoenhofen@gmail.com>
…compare


Suggested by Denver, tested on Python 3.10 and 3.8

Co-authored-by: Jonah Lawrence <jonah@freshidea.com>
Copy link
Collaborator

@EmreTech EmreTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested
Although, I think the title should be changed to explicitly state that this adds support for 3.10 unions because giving the pep number doesn't showcase this right away.

Copy link
Collaborator

@DenverCoder1 DenverCoder1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested but looks good to me.

@alentoghostflame alentoghostflame changed the title feat(app cmds): Adds PEP 604 support. feat(app cmds): Adds support for 3.10 unions Oct 24, 2022
@ooliver1 ooliver1 changed the title feat(app cmds): Adds support for 3.10 unions feat(app-cmds): add support for 3.10 unions Oct 24, 2022
@ooliver1 ooliver1 added t: enhancement Type: enhancement - new feature or request p: medium Priority: medium - should be worked on in the near future s: awaiting review Status: the issue or PR is awaiting reviews 2.3 The issue/PR should go for the 2.3 release labels Oct 24, 2022
@ooliver1 ooliver1 added this to the 2.3 milestone Oct 24, 2022
# Conflicts:
#	nextcord/application_command.py
Copy link
Member

@ooliver1 ooliver1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with channel type unions.

@ooliver1 ooliver1 merged commit 58302d7 into nextcord:master Oct 30, 2022
@ooliver1 ooliver1 removed the s: awaiting review Status: the issue or PR is awaiting reviews label Oct 30, 2022
@alentoghostflame alentoghostflame deleted the app_cmd_py_10 branch March 17, 2023 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.3 The issue/PR should go for the 2.3 release p: medium Priority: medium - should be worked on in the near future t: enhancement Type: enhancement - new feature or request
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants