Skip to content

Normative Conventions: pretend primitives aren't iterable - #152

Merged
michaelficarra merged 6 commits into
mainfrom
michaelficarra-patch-1
Aug 7, 2024
Merged

michaelficarra merged 6 commits into
mainfrom
michaelficarra-patch-1

Conversation

@michaelficarra

Copy link
Copy Markdown
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
Comment thread normative-conventions.md Outdated

@bakkot bakkot left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

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

@bakkot

bakkot commented Jul 3, 2024

Copy link
Copy Markdown
Member

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

@bakkot

bakkot commented Jul 17, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

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

Comment thread normative-conventions.md Outdated
Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
Comment thread normative-conventions.md Outdated
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