SimpleIterator.jl

Simple iterator interface like python.
Author yhqjohn
Popularity
0 Stars
Updated Last
1 Year Ago
Started In
November 2023

SimpleIterator

Stable Dev Build Status

SimpleIterator.jl is a Julia package that provides a simple Python-like iterator interface for Julia. It enables the iteration of an object x becomes iteration over iterator(x). The iteration behavior can be easily customized by overloading the iterator function and returning the desired iterator object.

struct MyType
    data::Vector{Int}
end

@iterfn iterator(x::MyType) = x.data

for i in MyType([1, 2, 3])
    @show i
end

Installation

] add SimpleIterator

Required Packages

Used By Packages

No packages found.