-
Notifications
You must be signed in to change notification settings - Fork 886
Use zip() for positional argument compatibility #403
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
Conversation
The list returned by zip() is automatically truncated to the length of the shortest argument list, which greatly simplifies the code that loops through the list of positional arguments. The expression `if len(args):` relies on the truthiness of `len(args)`; using `if args:` does not change the behaviour of the conditional, but is easier to understand at a glance (the length of args is irrelevant).
2 similar comments
+1 from me. |
Sorry but I'm having a little trouble understanding why this pull request was made. I'm sure the change is a good one -- if we were keeping that code, but the change even affected the code which raises the In fact, while working on the next release, I have already deleted this code. So it is unclear what value making this change would serve. |
Ah, it didn't occur to me that this code was being removed in the next release; I agree that this change is unnecessary. Would it be alright to repurpose this PR into one that just contains iKevinY@40c968e? |
Yes, that would be great. Thanks. |
I found it irritating that the branch name was still going to be |
@waylan, do you mean that there will be no more releases from this repository? If yes, maybe it will make sense to stop accepting pull requests here and mention in the README that the code has been moved? |
This repo is in "maintenance mode" and may receive future minor bug-fix releases. So far all accepted changes have fallen under that category. However you make a point, I probably should make a note of that somewhere. |
This PR refactors
__init__.py
to usezip()
for positional argument compatibility, and also fixes some miscellaneous capitalization/spelling errors.zip()
is automatically truncated to the length of the shortest argument list, which greatly simplifies the code that loops through the list of positional arguments.if len(args):
relies on the truthiness oflen(args)
; usingif args:
does not change the behaviour of the conditional, but is easier to understand at a glance (since what's really being checked is whether or not there are any arguments).