Skip to content

Conversation

@irh
Copy link
Contributor

@irh irh commented Jan 8, 2025

Backport of e2bf2b5 for 0.15.1.

See #401.

Backport of e2bf2b5

The instance checks in the `iterator` module use `KValue::is_iterable`
to decide whether or not to accept the instance provided to the call.

When used as standalone functions, adaptors like
`iterator.enumerate(1..10)` were accepting the `iterator` module causing
an error to be thrown.

The fix is to extend the `is_iterable` logic to only accept object-like
maps if they implement `@iterator` or `@next`.
@irh irh merged commit 117ab52 into v0.15-fixes Jan 8, 2025
8 checks passed
@irh irh deleted the backport-iterator-standalone-function-fix branch January 8, 2025 14:01
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.

2 participants