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

Normative Conventions: pretend primitives aren't iterable #152

Merged
merged 6 commits into from
Aug 7, 2024

Conversation

michaelficarra
Copy link
Member

We discussed this in the June plenary while considering iterator helper follow-on proposals. While we didn't call for consensus on it, there were many voices in support of this and none opposed. I will propose we officially adopt it at an upcoming plenary.

@michaelficarra michaelficarra requested a review from bakkot June 19, 2024 00:00
normative-conventions.md Outdated Show resolved Hide resolved
Copy link
Contributor

@bakkot bakkot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Gotta do that followup to add .codepoints() and/or similar methods for getting iterators though.

@michaelficarra michaelficarra changed the title Normative Conventions: pretend Strings aren't iterable Normative Conventions: pretend primitives aren't iterable Jun 19, 2024
@michaelficarra michaelficarra force-pushed the michaelficarra-patch-1 branch from 1627148 to d428162 Compare July 3, 2024 15:25
@michaelficarra
Copy link
Member Author

I think we could probably get away with also changing Iterator.from to reject primitives.

@bakkot
Copy link
Contributor

bakkot commented Jul 3, 2024

Iterator.from is a coercion method, so its input type should be looser. We specifically discussed that exact question, including in plenary.

@bakkot
Copy link
Contributor

bakkot commented Jul 17, 2024

Possibly worth calling out that this applies to async-iterable-taking positions as well.

@michaelficarra michaelficarra force-pushed the michaelficarra-patch-1 branch from 311e718 to a73fa06 Compare July 23, 2024 17:58
@michaelficarra
Copy link
Member Author

@syg I've added the enumeration of all positions where primitives are currently iterated. Please review.

normative-conventions.md Outdated Show resolved Hide resolved
Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
normative-conventions.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants