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

Add manual iterator implementations for custom vec iterables #1107

Merged
merged 6 commits into from
Feb 21, 2024

Commits on Feb 21, 2024

  1. Add manual iterator implementations for custom vec iterables

    This adds manual `Iterator` implementors for the custom vec `Iterable`
    pyclasses, which were previously using the Python default iterator
    implementation that attempts calls to `__getitem__` with successive
    integers until an `IndexError` is raised.
    
    Doing this means that we no longer have any overhead from converting
    Python-space integer indices to Rust-space ones, because we just store
    a pointer to the backing vec internally and yield from that using an
    index we track ourselves.
    jakelishman committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    1373756 View commit details
    Browse the repository at this point in the history
  2. Add release note

    jakelishman committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    8f9a991 View commit details
    Browse the repository at this point in the history
  3. Remove __len__ from custom iterators

    This matches the Python behaviour for the implicit sequence-protocol
    iterators; they have only `__length_hint__` and not `__len__`.
    jakelishman committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    37d7390 View commit details
    Browse the repository at this point in the history
  4. Add reversed iterators

    jakelishman committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    5f60d9e View commit details
    Browse the repository at this point in the history
  5. Add explicit tests

    jakelishman committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    b68aa5f View commit details
    Browse the repository at this point in the history
  6. Fixup release note

    jakelishman committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    ed6e820 View commit details
    Browse the repository at this point in the history