title: Python Hypothesis: How to compose generators that are dependent on each other?
body: <p>I have a generator using python Hypothesis like the following:</p>
  <pre><code>@st.composite
  def generate_network_fault_only(draw):
      fault = {
          &quot;impaired&quot;: st.just(True),   # need to detect if all faults are None to switch this back.
          &quot;limit&quot;: draw(NetworkFaultGen.generate_limit()),
          &quot;delay&quot;: draw(NetworkFaultGen.generate_delay()),
          &quot;loss_random&quot;: draw(NetworkFaultGen.generate_loss_random()),
          &quot;corrupt&quot;: draw(NetworkFaultGen.generate_corrupt()),
          &quot;duplicate&quot;: draw(NetworkFaultGen.generate_duplicate()),
          &quot;reorder&quot;: draw(NetworkFaultGen.generate_reorder()),
          &quot;rate&quot;: draw(NetworkFaultGen.generate_rate())
      }
  
      return draw(st.fixed_dictionaries(fault))
  </code></pre>
  <p>Each of the functions above returns something like:</p>
  <pre><code>@st.composite
  def generate_reorder(draw):
      &quot;&quot;&quot;
      This must only happen if delay is applied
      &quot;&quot;&quot;
      return st.one_of(st.fixed_dictionaries(
                {&quot;percent&quot;: st.integers(min_value=0, max_value=100),
                 &quot;correlation&quot;: st.integers(min_value=0, max_value=100),
                 &quot;distance&quot;: st.integers(min_value=0)}),st.none())
  </code></pre>
  <p>I have a dependency between the <code>reorder</code> value and the <code>delay</code> value in that reorder can only be specified if delay is not <code>None</code>.</p>
  <p>I am not sure how to accomplish this. Filtering seems to run into performance issues. And at this point in the code the <code>delay</code> value isnt a concrete value yet.</p>