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.

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
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
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
normative-conventions.md Outdated Show resolved Hide resolved
@michaelficarra michaelficarra merged commit 8fc1995 into main Aug 7, 2024
2 checks passed
@michaelficarra michaelficarra deleted the michaelficarra-patch-1 branch August 7, 2024 21:53
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