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

Minor refactoring of the sync algo #240

Merged
merged 2 commits into from
Dec 29, 2021
Merged

Conversation

EQUENOS
Copy link
Member

@EQUENOS EQUENOS commented Dec 29, 2021

Summary

Added InteractionBotBase.application_commands_iterator property that uses itertools.chain to concatenate 3 iterators.
Some methods are now iterating through .application_commands_iterator instead of application_commands (a set) which is of course more efficient.

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 pre-commit run --all-files
  • 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, ...)

@thesadru
Copy link
Collaborator

Wouldn't it be better to make the iterator a function instead? I think it's normal to assume that next(object.iterator) will affect the attribute and making the iterator a property could cause some issues with readability.

@EQUENOS
Copy link
Member Author

EQUENOS commented Dec 29, 2021

Good point

@shiftinv shiftinv added t: enhancement New feature s: needs review Issue/PR is awaiting reviews labels Dec 29, 2021
@EQUENOS EQUENOS merged commit 1f55fb0 into master Dec 29, 2021
@EQUENOS EQUENOS deleted the feature/minor_refactoring branch December 29, 2021 15:48
@onerandomusername onerandomusername removed the s: needs review Issue/PR is awaiting reviews label Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: enhancement New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants