Skip to content

fix(typing): Fix typing and other related issues in embeds.py - #3446

Open
ToothyDev wants to merge 9 commits into
masterfrom
fix/improve-embeds-typing
Open

ToothyDev wants to merge 9 commits into
masterfrom
fix/improve-embeds-typing

Conversation

@ToothyDev

@ToothyDev ToothyDev commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This solves every type error / warning reported by bpr set to "all" in embeds.py. I had to be a bit creative with changing types at times (esp. Mapping) so tell me if this is all right. It's also untested so far, since I did change a bit of code as well, but functionality should be the same.

AI (Claude) was used to quickly generate a test suite for every embed feature, editing, (de)serialisation etc. which would have taken me forever; It passed against master and failed against my code, so I adjusted it to pass. Confident now that there are no leftover regressions

Information

  • 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, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes. -> No need
  • I have read the Contributing Guidelines.
  • AI Usage has been disclosed.
    • If AI has been used, I understand fully what the code does

@ToothyDev
ToothyDev requested review from a team, Paillat-dev and plun1331 November 12, 2026 09:34
@ToothyDev ToothyDev added hold: testing This pull request requires further testing typing Is related to / changes python typing labels Nov 12, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Pycord Nov 12, 2026
@pycord-app

pycord-app Bot commented Nov 12, 2026

Copy link
Copy Markdown

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/3446/head:pr-3446
git checkout pr-3446

This pull request can be installed with:

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

Comment thread discord/embeds.py Resolved
Comment thread discord/embeds.py Resolved
Comment thread discord/embeds.py Resolved
Comment thread discord/embeds.py Resolved
Comment thread discord/embeds.py Resolved
Comment thread discord/embeds.py Resolved
Comment thread discord/embeds.py Resolved
plun1331

This comment was marked as duplicate.

@ToothyDev

Copy link
Copy Markdown
Contributor Author

6 basedpyright errors remain now, all of which being "Unreachable Code" which as we established isn't quite true, if users do user things

@ToothyDev ToothyDev removed the hold: testing This pull request requires further testing label Nov 13, 2026
@ToothyDev

Copy link
Copy Markdown
Contributor Author

I let Claude generate a throwaway test suite (179 tests) that succeeded against master, and then ran it again on my code. The only failures really came from me missing that the lib uses del on some attributes which I didn't expect, and an oversight on my side (setting _attributes manually after they were already set by a setter). Now the test suite passes and so I'm confident there are no more regression. It tested every embed feature and (de)-serialisation as well as editing, so I think I'm not missing anything

@Paillat-dev

Copy link
Copy Markdown
Member

@ToothyDev If could add some actually good and not throwaway tests on embeds.py that could be nice I guess.

Co-authored by Claude as per PR description
@ToothyDev
ToothyDev requested a review from a team as a code owner November 14, 2026 23:09

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants