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

grouper signature doesn't match recipe #256

Closed
jaraco opened this issue Jan 3, 2019 · 3 comments
Closed

grouper signature doesn't match recipe #256

jaraco opened this issue Jan 3, 2019 · 3 comments

Comments

@jaraco
Copy link
Contributor

jaraco commented Jan 3, 2019

In #38, I suggested that chunked should match grouper. What I didn't realize at the time is that the signature for grouper doesn't match what's in the stdlib docs. Here's what I see for stdlib:

image

But the signature for the implementation herein switches the order of parameters.

https://github.com/erikrose/more-itertools/blob/1a3682b87a78416711fdeea7ef050e997d5e4e4b/more_itertools/recipes.py#L288-L296

I'd have expected the recipes to match the documentation in the stdlib... or at least call out when the signature doesn't match. Best would be for it to match so that someone doesn't read the stdlib docs, find the recipe they need, pull in more-itertools to use it, then find that it's not implemented that way in more_itertools.

Did the order of the parameter change in the stdlib recipe?

Would you consider a pull request to give compatibility for either order of parameters and raise a DeprecationWarning when they're not in the new, preferred order as found in stdlib docs?

@bbayles
Copy link
Collaborator

bbayles commented Jan 3, 2019

Odd! It looks like this was added in 2012, and then the docs recipe changed in 2013.

I'll take a PR to do either order and raise DeprecationWarning, yeah.

@jaraco
Copy link
Contributor Author

jaraco commented Jan 3, 2019

Nice work on the spelunking.

@bbayles
Copy link
Collaborator

bbayles commented Jan 4, 2019

Many thanks - I wouldn't have guessed that that change would have made it into the recipes.

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

No branches or pull requests

2 participants