Top "Generator" questions

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

What is the return type hint of a generator function?

I'm trying to write a :rtype: type hint for a generator function. What is the type it returns? For example, …

python python-2.7 generator yield type-hinting
What is the default generator for CMake in Windows?

When running CMake on one PC, CMake generates NMake files by default. On another, it generates a Visual Studio project. …

c visual-studio cmake generator nmake
Text based UML Diagram Generators

Which generator tools do you know that are able to generate UML (and perhaps other) diagrams out of text (simple …

svg uml ascii generator diagram
generator-karma does not satisfy its siblings' peerDependencies requirements

The same notorious error npm ERR! peerinvalid The package generator-karma does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid …

node.js angularjs generator yeoman karma-runner
Cartesian product of a dictionary of lists

I'm trying to write some code to test out the Cartesian product of a bunch of input parameters. I've looked …

python generator combinatorics
Realistic 2D terrain map generation

I am looking for some algorithms which allow me to generate a realistic 2D terrain map. By realistic I mean …

2d generator terrain
What's the most Pythonic way to identify consecutive duplicates in a list?

I've got a list of integers and I want to be able to identify contiguous blocks of duplicates: that is, …

list duplicates generator python
Are Generators Threadsafe?

I have a multithreaded program where I create a generator function and then pass it to new threads. I want …

python multithreading thread-safety generator
How to use random.shuffle() on a generator? python

How do I use random.shuffle() on a generator without initializing a list from the generator? Is that even possible? …

python list random generator shuffle
PHP brute force password generator

I want to be able to input a number and get a password, built from a string or unique characters. …

php passwords generator brute-force