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 the signature of Iter's map_stateful/map to not require ephemerals #4026

Merged
merged 3 commits into from
Feb 22, 2022

Conversation

jasoncarr0
Copy link
Contributor

@jasoncarr0 jasoncarr0 commented Feb 20, 2022

This fixes a small stdlib issue discovered during: #4018

The signatures for map and map_stateful in itertools were overly strict, requiring B^ instead of just B, but only returned Iter[B]. Thus it had to be instantiated with iso^ in some cases, exercising a bug with double ephemerals.

This is not a breaking change.

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Feb 20, 2022
@jasoncarr0 jasoncarr0 changed the title Fix the signature map_stateful/map to not require ephemerals Fix the signature of itertools' map_stateful/map to not require ephemerals Feb 20, 2022
@jasoncarr0 jasoncarr0 changed the title Fix the signature of itertools' map_stateful/map to not require ephemerals Fix the signature of Iter's map_stateful/map to not require ephemerals Feb 20, 2022
@jasoncarr0
Copy link
Contributor Author

jasoncarr0 commented Feb 20, 2022

There are some other possible changes we might want to make (filter_map can be a bit stronger likewise) but those would possibly be breaking changes, although one might argue that they are still fixes.

@jasoncarr0 jasoncarr0 added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Feb 20, 2022
@SeanTAllen SeanTAllen merged commit d944ca2 into main Feb 22, 2022
@SeanTAllen SeanTAllen deleted the fix-overly-strict-itertools branch February 22, 2022 02:29
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Feb 22, 2022
github-actions bot pushed a commit that referenced this pull request Feb 22, 2022
github-actions bot pushed a commit that referenced this pull request Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants