Skip to content

Correct boltons IndexedSet iter_slice bounds and item type - #16971

Open
Lushiyao5 wants to merge 1 commit into
python:mainfrom
Lushiyao5:fix-boltons-indexedset-iter-slice
Open

Lushiyao5 wants to merge 1 commit into
python:mainfrom
Lushiyao5:fix-boltons-indexedset-iter-slice

Conversation

@Lushiyao5

Copy link
Copy Markdown
Contributor

IndexedSet.iter_slice() accepts None for either bound and returns an itertools.islice that yields the set members. The current stub requires integers for both bounds and incorrectly declares each yielded item as an iterable. Update the bounds and use the same item type as IndexedSet.__iter__.

I verified bounded and open-ended slices from an indexed set of strings, including passing each result directly to str.join(). Mypy rejects those valid joins and open bounds before the patch. The examples and updated stub pass afterward.

This patch was prepared with assistance from OpenAI Codex.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

This branch has not been deployed

No deployments
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.

1 participant