Repository navigation
Conversation
|
Thanks for opening this pull request! This pull request can be checked-out with: git fetch origin pull/3494/head:pr-3494
git checkout pr-3494This pull request can be installed with: pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3494/head |
Contributor
|
There is a (kindof) stale refactor happening at #3126 But I also think it may be good to fix this now rather than later. |
Member
|
This is already being worked on in #3126 (also linked to the issue !). Furthermore, we are pausing fixes on options-related code before a refactor due to issues with design. Adding additional patches on top does not make the codebase easier to rework. For the above reason we'd also rather if a human worked on this. |
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
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
Supports
typing.Literal[...]annotations inOption.__init__and the@optiondecorator so parameters annotated withLiteral[...]no longer raiseTypeError: issubclass() arg 1 must be a classwheninput_typeis omitted.str,int, orfloatLiteralvalues (rejectingbooland mixed types, matchingSlashCommand._parse_options).input_typeand defaultOptionChoices from theLiteralvalues whenchoicesis omitted.choices=...passed to@option/Optionwhen provided.Literal[...] | None/Optional[Literal[...]]via existing_strip_none_type.tests/test_options.pycovering explicit choices, inferred choices, customOptionChoiceoverrides,int/ optionalLiteral, and invalidLiteralerror cases.Fixes #3091
Information
AI Usage Disclosure
AI Usage has been disclosed: Antigravity (AI coding assistant) was used to help diagnose the root cause in
discord/commands/options.py, draft the fix and unit tests intests/test_options.py, and run local checks (pytest,black --check, andbasedpyright). The diff and test results were reviewed before submission.Checklist
blackto format my changes.