The internal peekable implementation doesn't support having None as a valid value (for example Peekable[int | None] will not work). We could fix it, but there is also an implementation in more-itertools which seems popular and well maintained, so we could just switch to using that one.
Originally posted by @llucax in #1295 (comment)