# Creating Generators

**URL:** <https://discourse.julialang.org/t/creating-generators/3962>\
**Category:** General Usage\
**Tags:** generator\
**Created:** [May 28, 2017, 12:14pm UTC](https://discourse.julialang.org/t/creating-generators/3962 "2017-05-28T12:14:17Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![fengyang.wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fengyang.wang/32/104_2.png) [@fengyang.wang](https://discourse.julialang.org/u/fengyang.wang)\
**Post date:** [May 29, 2017, 7:18am UTC](https://discourse.julialang.org/t/creating-generators/3962/4 "2017-05-29T07:18:52Z")

</div>

Have you seen `Channel`s? They are the direct Julia equivalent of Python generators.

> [@PyGen - python style generators](https://discourse.julialang.org/t/pygen-python-style-generators/3451/14):
>
> And even better (in my opinion), combining it with short-form function syntax, f(x) = Channel() do c ... push!(c, y) ... end Effectively a macro-free way of defining a python-like generator.

---

_[View the full topic](https://discourse.julialang.org/t/creating-generators/3962)._
