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

Fix min/max functions with generators, and 'None' default #514

Merged
merged 5 commits into from
Oct 24, 2019

Conversation

gazpachoking
Copy link
Contributor

@gazpachoking gazpachoking commented Oct 17, 2019

I allowed a few fixes to creep into this PR, I can separate them out if desired. This PR addresses:

  • There is an issue with the min/max functions consuming the first argument of iterators that cannot be looped over more than once. max() over itertools.ifilter() is broken in 0.18.0 #510
  • The new min/max functions did not allow None as a default.
  • Aligned the error message when an empty sequence was passed to the new min/max functions to be the same as the builtin min/max error message.

@gazpachoking
Copy link
Contributor Author

Oops, didn't see we already had some tests in test_builtins. I'll just add the appropriate new tests there.

@gazpachoking gazpachoking marked this pull request as ready for review October 18, 2019 01:52
@gazpachoking
Copy link
Contributor Author

A couple more changes crept into this PR, updated the original PR text to reflect this.

@gazpachoking gazpachoking changed the title Fix min/max functions with generators Fix min/max functions with generators, and 'None' default Oct 18, 2019
@gazpachoking
Copy link
Contributor Author

Not sure why travis isn't adding the results here, pretty sure the 2.6 failures have nothing to do with this PR though. https://travis-ci.org/PythonCharmers/python-future/builds/599676065

@megies
Copy link
Contributor

megies commented Oct 21, 2019

I can confirm this fixes an issue for me which looks like what is described in #510 first post, see #510 (comment).

I recommend merging and releasing this

@jmadler jmadler merged commit 228a297 into PythonCharmers:master Oct 24, 2019
@gazpachoking gazpachoking deleted the fix_min_max branch December 6, 2019 04:28
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.

3 participants