title: Tying random seed to an instance of class in python
body: <p>Suppose that I have a class TestClass(), that has methods that return random numbers generated by either random, numpy or scipy modules. How could I, without modifying the content of the TestClass() make, lets say two instances of the TestClass(), t1 and t2, that will always generate the same random numbers as each other?</p>
  <p>For example, suppose that there is a method sample_from_normal_dist().</p>
  <p>I would like to have the following behaviour.</p>
  <pre><code>print(t1.sample_from_normal_dist(), t2.sample_from_normal_dist())
  
  print(t1.sample_from_normal_dist(), t2.sample_from_normal_dist())
  </code></pre>
  <p>Output:</p>
  <p>0.75 0.75</p>
  <p>-0.21 -0.21</p>
  <p>And I want this to hold for all methods that have to do with generating random numbers.</p>