Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
jmadler merged 5 commits intoPythonCharmers:masterPythonCharmers/python-future:masterfrom
gazpachoking:fix_min_maxgazpachoking/python-future:fix_min_maxCopy head branch name to clipboard
Oct 24, 2019
Merged

Fix min/max functions with generators, and 'None' default#514
jmadler merged 5 commits intoPythonCharmers:masterPythonCharmers/python-future:masterfrom
gazpachoking:fix_min_maxgazpachoking/python-future:fix_min_maxCopy head branch name to clipboard

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.