Skip to content

chore: rename __repr_info__ -> __repr_attributes__, enable RUF005#1320

Merged
shiftinv merged 5 commits intomasterfrom
chore/repr-attributes
Aug 25, 2025
Merged

chore: rename __repr_info__ -> __repr_attributes__, enable RUF005#1320
shiftinv merged 5 commits intomasterfrom
chore/repr-attributes

Conversation

@shiftinv
Copy link
Member

Summary

#1294 (comment)

Checklist

  • If code changes were made, then they have been tested
    • I have updated the documentation to reflect the changes
    • I have formatted the code properly by running pdm lint
    • I have type-checked the code by running pdm pyright
  • 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, ...)

@shiftinv shiftinv added this to the disnake v2.11 milestone Aug 25, 2025
@shiftinv shiftinv added t: refactor/typing/lint Refactors, typing changes and/or linting changes skip news labels Aug 25, 2025
@shiftinv shiftinv mentioned this pull request Aug 25, 2025
8 tasks
Copy link
Contributor

@Enegg Enegg left a comment

Choose a reason for hiding this comment

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

[nit] RUF005 says to prefer unpacking over concatenation, we may want to comply in those places?

shiftinv and others added 3 commits August 25, 2025 18:50
Co-authored-by: Eneg <42005170+Enegg@users.noreply.github.com>
Signed-off-by: vi <8530778+shiftinv@users.noreply.github.com>
@shiftinv
Copy link
Member Author

shiftinv commented Aug 25, 2025

we considered RUF005 back then: #935 (comment)
At least in my limited testing, unpacking is really only faster than concatenation when there are 3+ collections involved (and slower with only 2), which isn't the case in any of the current RUF005 violations, but there's definitely a readability benefit in many cases, so let's re-enable it.

@shiftinv shiftinv changed the title chore: rename __repr_info__ -> __repr_attributes__ chore: rename __repr_info__ -> __repr_attributes__, enable RUF005 Aug 25, 2025
@shiftinv shiftinv merged commit 75a6e77 into master Aug 25, 2025
29 checks passed
@shiftinv shiftinv deleted the chore/repr-attributes branch August 25, 2025 19:02
@Enegg
Copy link
Contributor

Enegg commented Aug 25, 2025

lgtm 👍 yes I'm aware it was merged

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

Labels

skip news t: refactor/typing/lint Refactors, typing changes and/or linting changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants