Skip to content
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
/ PyGen Public archive

Python generators in Julia, yield statements for all!

License

Notifications You must be signed in to change notification settings

nsmith5/PyGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IMPORANT: See the ResumableFunctions package for a performant and more complete implementation of this concept

PyGen travis-img codecov-img

Python generators are great, Julia is great. Why compromise?

julia> using PyGen

julia> @pygen function fibonacci()
           n, m = 0, 1
           while true
               yield(m)
               n, m = m, n + m
           end 
       end
fibonacci (generic function with 1 method)

julia> for i in fibonacci()
           println(i)
           sleep(1)
       end
1
1
2
3
5
8
13
.
.
.

Voila! Generators without all the ceremony!

About

Python generators in Julia, yield statements for all!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages