title: Use _replace method of namedtuple to update the fields of other data structures containing the nt
body: <p>I am learning about namedtuple. I would like to find a way, using the <code>._replace</code> method, to update all the appearances of a <code>namedtuple</code> wherever they are.</p>
  
  <p>Say I have a list of nodes, and lists of elements (two-node beams, four-node quads) and boundaries ("one node" elements) defined by these nodes. </p>
  
  <p>I am playing around with doing this:</p>
  
  <pre><code>from collections import namedtuple as nt
  Node = nt('Node', 'x y')
  Beam = nt('Beam', 'i j')
  Quad = nt('Quad', 'i j k l')
  Boundary = nt('Boundary', 'b')
  #Define some nodes:
  n1 = Node(0,0)
  n2 = Node(0,1)
  n3 = Node(1,1)
  n4 = Node(1,0)
  #And some other things using those nodes:
  q1 = Quad(n1,n2,n3,n4)
  b1 = Boundary(n1)
  be1 = Beam(n1,n4)
  </code></pre>
  
  <p>Now, if I replace <code>n1</code> with a new <code>Node</code>:</p>
  
  <pre><code>n1 = n1._replace(x=0.5,y=0.5)
  print(n1)  # Node(x=0.5,y=0.5)
  </code></pre>
  
  <p>None of the other items are updated:</p>
  
  <pre><code>print(b1)  # Boundary(b=Node(x=0, y=0))
  </code></pre>
  
  <p>I understand the Python naming and object model and the <em>why</em> behind this: <code>b1.b</code> has been set to the <em>object</em> <code>Node(0,0)</code>, <em>not</em> the name <code>n1</code>. So when <code>n1</code> is changed, the other namedtuples still contain the same object as before, while <code>n1</code> gets a new object. </p>
  
  <p>What I would like to do is change this behavior so that when I change <code>n1</code>, the changes are "felt" in <code>b1</code>, <code>be1</code>, <code>q1</code>, etc. How can I do this? </p>