Top "Generator" questions

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

Why can't generators be pickled?

Python's pickle (I'm talking standard Python 2.5/2.6/2.7 here) cannot pickle locks, file objects etc. It also cannot pickle generators and lambda …

python generator pickle python-stackless
Getting a promise's value via yield & co

I'm trying to figure out how to get the value of a promise via yield, possibly with "co": function *(){ var …

javascript node.js generator ecmascript-harmony co
How to write Python generator function that never yields anything

I want to write a Python generator function that never actually yields anything. Basically it's a "do-nothing" drop-in that can …

python generator yield
Generator of evenly spaced points in a circle in python

I am tasked with generating evenly (more or less) spaced points on concentric rings of an invisible circle. The function …

python generator physics geometry points
How is irange() any different from range() or xrange()?

I was going through Python Generators Wiki when I came across this RangeGenerator page which talks about irange() - This …

python range generator xrange
reject in promise undefined

I tried below function use co and javascript promise test, the fulfill will success return but reject not, and catch …

javascript node.js promise generator co
Loop over two generator together

I have two generators say A() and B(). I want to iterate over both the generators together. Something like: for …

python loops for-loop generator yield
Pseudo Random Number Generator using LFSR in VHDL

I'm having a bit of trouble creating a prng using the lfsr method. Here is my code: library IEEE; use …

random numbers vhdl generator lfsr
Generating unique codes in PHP/MySQL?

I'm working with a client that needs to generate millions of the alphanumeric codes used in magazine scratch-off cards, bottlecap …

php mysql random generator serial-number
Flexible traffic generation with scapy

I know questions like this have been asked plenty of times before, but I think this is subtley different. I …

python generator traffic scapy