-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Improve documentation on what len() on ExactSizeIterator means #66491
Copy link
Copy link
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-iteratorsArea: IteratorsArea: IteratorsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-iteratorsArea: IteratorsArea: IteratorsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Type
Fields
Give feedbackNo fields configured for issues without a type.
If the wrapped iterator implements
ExactSizeIteratorthenFuseblindly delegateslen()to it. The underlying iterator may know its exact size but return spuriousNoneresults anyway, on whichFusewill stop iterating even though the source knows that there are elements left to iterate, meaningFusewill indicate that there are elements left but never return them.The behavior was introduced in #37944 but didn't see any discussion.
Playground demo