Skip to content

Conversation

Copy link

Copilot AI commented Nov 2, 2025

The flatten_literal_params function in discord/utils.py became dead code after removing Python < 3.10 compatibility. It was previously called conditionally in evaluate_annotation to flatten nested Literal types on older Python versions:

# Before (in master):
if tp.__origin__ is Literal:
    if not PY_310:
        args = flatten_literal_params(tp.__args__)  # Only for Python < 3.10
    
# After PR #2988:
if tp.__origin__ is Literal:
    # flatten_literal_params no longer called

Changes

  • Removed flatten_literal_params function (11 lines) from discord/utils.py
  • No other code references this function

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@pycord-app
Copy link

pycord-app bot commented Nov 2, 2025

Thanks for opening this pull request!
Please make sure you have read the Contributing Guidelines and Code of Conduct.

This pull request can be checked-out with:

git fetch origin pull/2989/head:pr-2989
git checkout pr-2989

This pull request can be installed with:

pip install git+https://github.com/Pycord-Development/pycord@refs/pull/2989/head

Copilot AI changed the title [WIP] Address feedback on 3.9 cleanup for 3.14 preparation Remove unused flatten_literal_params function Nov 2, 2025
Copilot AI requested a review from Lulalaby November 2, 2025 03:26
Copilot finished work on behalf of Lulalaby November 2, 2025 03:26
@Lulalaby Lulalaby marked this pull request as ready for review November 2, 2025 03:26
@Lulalaby Lulalaby requested a review from a team as a code owner November 2, 2025 03:26
@Lulalaby Lulalaby merged commit 5ddd192 into cleanup/39-removal-314-prepare Nov 2, 2025
26 of 50 checks passed
@Lulalaby Lulalaby deleted the copilot/sub-pr-2988 branch November 2, 2025 03:26
Lulalaby added a commit that referenced this pull request Nov 2, 2025
* Initial plan

* Remove unused flatten_literal_params function

Co-authored-by: Lulalaby <[email protected]>

---------

Co-Authored-By: copilot-swe-agent[bot] <[email protected]>
Co-Authored-By: Lulalaby <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants