Skip to content

yhqjohn/SimpleIterator.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple iterator interface like python.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages