Generation ========== Given a predicate, py-predicate is able to generate sample data that satisfy that predicate: NOTE: this feature was introduced in version 0.4 and is not complete yet. generate_true ------------- This function returns an (potentially infinite, and potentially empty) iterable of values that satisfy the given predicate. Use `take `_ from `More Itertools `_ to limit the number of return values. .. code-block:: python from predicate import generate_true, is_int_p from more_itertools import take take(5, generate_true(is_int_p)) In this example we generate 5 values, that will result in True for this predicate. generate_false -------------- This function returns an (potentially infinite, and potentially empty) iterable of values that don't satisfy the given predicate. .. code-block:: python from predicate import generate_false, is_int_p from more_itertools import take take(5, generate_false(is_int_p)) In this example we generate 5 values, that will result in False for this predicate. Note that these values can be anything (strings, floats, dicts, etc.)