Top "Generator" questions

A generator is a generalisation of a subroutine, primarily used to simplify the writing of iterators.

Looking for a good Image Sprite generator tool

I looking for a decent Image sprite generator. I tried http://spritegen.website-performance.org/ but it's not "smart" enough to …

generator css-sprites sprite
yield break in Python

According to answer to this question, yield break in C# is equivalent to return in Python. In the normal case, …

python generator yield
How to Pythonically yield all values from a list?

Suppose I have a list that I wish not to return but to yield values from. What is the most …

python generator yield
Is it possible to convert a list-type into a generator without iterating through?

I know that it's possible to convert generators into lists at a "low-level" (eg. list(i for i in xrange(10))), …

python list generator
Syntax to skip creating tests, assets & helpers for `rails generate controller`?

I read the help & tried the following command to skip generation of tests, assets & helper files $ bin/rails …

ruby-on-rails ruby-on-rails-3 generator
python yield and stopiteration in one loop?

i have a generator where i would like to add an initial and final value to the actual content, it's …

python generator stopiteration
Distinction between iterator and enumerator

An interview question for a .NET 3.5 job is "What is the difference between an iterator and an enumerator"? This is …

c# .net iterator generator enumeration
Difference between async/await and ES6 yield with generators

I was just reading this fantastic article «Generators» and it clearly highlights this function, which is a helper function for …

javascript node.js ecmascript-6 generator ecmascript-next
Python SyntaxError: ("'return' with argument inside generator",)

I have this function in my Python program: @tornado.gen.engine def check_status_changes(netid, sensid): como_url = "".join([…

python return generator tornado
Simple random english sentence generator

I need a simple random English sentence generator. I need to populate it with my own words, but it needs …

random generator markov-chains