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

Improve flip to accept *args and kwargs #566

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brl0
Copy link

@brl0 brl0 commented May 27, 2023

First, thanks for the great project!

Currently, flip is limited to two arguments, and it does not handle keyword arguments.
I might be missing something, but this seems easy to fix, and should be a non-breaking change.

Let me know if any other changes are needed.

@groutr
Copy link
Contributor

groutr commented Jul 20, 2023

@brl0 I agree that flip is limited to two arguments and that generalizing is desirable, especially with keyword arguments. When there are two arguments, there is only one possible variation (a, b) -> (b, a). When there are more than two arguments, flip becomes ambiguous because more variations are possible. How often is it desirable to reverse the order of all of the positional arguments? Do you have a use case that this PR solves?

Would the approach in #546 work for your use case?

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